diff --git a/gradify.py b/gradify.py index 4b67f65..0a6b387 100644 --- a/gradify.py +++ b/gradify.py @@ -13,7 +13,7 @@ class Gradify(): """ # Cross browser prefixes. - BROWSER_PREFIXES = ["", "-webkit-", "-moz-", "-o-", "-ms-"] + BROWSER_PREFIXES = ["-webkit-", "-moz-", "-o-", "-ms-", ""] # Demo browser execution DEMO_CMD = { @@ -35,8 +35,10 @@ def __init__(self, black_sensitivity=4.3, white_sensitivity = 3, num_colors=4, r self.num_done = 0 - if webkit_only: - self.BROWSER_PREFIXES= ["-webkit-"] + self.init_CLI_args() + + if self.args.webkit_only or webkit_only: + self.BROWSER_PREFIXES= ["-webkit-", ""] self.IGNORED_COLORS = { "BLACK": { @@ -48,7 +50,6 @@ def __init__(self, black_sensitivity=4.3, white_sensitivity = 3, num_colors=4, r "radius": white_sensitivity } } - self.init_CLI_args() if self.args.demo: self.demo_file = "demo.html" @@ -76,6 +77,7 @@ def init_CLI_args(self): self.parser.add_argument("-f", "--file", help="Gradify single file") self.parser.add_argument("-c", "--classname", help="Specific classname of CSS to add gradients to (default is 'gradify')") self.parser.add_argument("--demo", help="Create example HTML file displaying results, opens when completed", action="store_true") + self.parser.add_argument("--webkit-only", help="Generate css for webkit only", action="store_true") self.args = self.parser.parse_args() return