diff options
author | Eevee (Lexy Munroe) <eevee.git@veekun.com> | 2016-06-08 17:51:56 -0700 |
---|---|---|
committer | Eevee (Lexy Munroe) <eevee.git@veekun.com> | 2016-06-08 17:51:56 -0700 |
commit | 791b05d7727006cd5a1e23a87a335b342c68540a (patch) | |
tree | 065bd67c4f90dcf3cfcb91909f35555949814f56 /scss | |
parent | 518e31f90b079ecf99201a1a9e73ff12787483d2 (diff) | |
download | pyscss-791b05d7727006cd5a1e23a87a335b342c68540a.tar.gz |
Support -moz-calc and -webkit-calc, too. Fixes #348
Diffstat (limited to 'scss')
-rw-r--r-- | scss/grammar/expression.g | 4 | ||||
-rw-r--r-- | scss/grammar/expression.py | 4 | ||||
-rw-r--r-- | scss/tests/files/general/css-calc.css | 2 | ||||
-rw-r--r-- | scss/tests/files/general/css-calc.scss | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/scss/grammar/expression.g b/scss/grammar/expression.g index 1341f1a..6fef9be 100644 --- a/scss/grammar/expression.g +++ b/scss/grammar/expression.g @@ -96,9 +96,9 @@ parser SassExpression: token VAR: "\$[-a-zA-Z0-9_]+" # Cheating, to make sure these only match function names. - token LITERAL_FUNCTION: "(calc|expression|progid:[\w.]+)(?=[(])" + token LITERAL_FUNCTION: "(-moz-calc|-webkit-calc|calc|expression|progid:[\w.]+)(?=[(])" token ALPHA_FUNCTION: "alpha(?=[(])" - token OPACITY: "(?:(?i)opacity)" + token OPACITY: "((?i)opacity)" token URL_FUNCTION: "url(?=[(])" # This must come AFTER the above token FNCT: "[-a-zA-Z_][-a-zA-Z0-9_]*(?=\()" diff --git a/scss/grammar/expression.py b/scss/grammar/expression.py index 88e3023..d3e5cbd 100644 --- a/scss/grammar/expression.py +++ b/scss/grammar/expression.py @@ -83,9 +83,9 @@ class SassExpressionScanner(Scanner): ('KWVAR', '\\$[-a-zA-Z0-9_]+(?=\\s*:)'), ('SLURPYVAR', '\\$[-a-zA-Z0-9_]+(?=[.][.][.])'), ('VAR', '\\$[-a-zA-Z0-9_]+'), - ('LITERAL_FUNCTION', '(calc|expression|progid:[\\w.]+)(?=[(])'), + ('LITERAL_FUNCTION', '(-moz-calc|-webkit-calc|calc|expression|progid:[\\w.]+)(?=[(])'), ('ALPHA_FUNCTION', 'alpha(?=[(])'), - ('OPACITY', '(?:(?i)opacity)'), + ('OPACITY', '((?i)opacity)'), ('URL_FUNCTION', 'url(?=[(])'), ('FNCT', '[-a-zA-Z_][-a-zA-Z0-9_]*(?=\\()'), ('BAREWORD', '(?!\\d)(\\\\[0-9a-fA-F]{1,6}|\\\\.|[-a-zA-Z0-9_])+'), diff --git a/scss/tests/files/general/css-calc.css b/scss/tests/files/general/css-calc.css index 6d13266..5f8cfac 100644 --- a/scss/tests/files/general/css-calc.css +++ b/scss/tests/files/general/css-calc.css @@ -1,3 +1,5 @@ p { + width: -moz-calc(100% - 10px); + width: -webkit-calc(100% - 10px); width: calc(100% - 10px); } diff --git a/scss/tests/files/general/css-calc.scss b/scss/tests/files/general/css-calc.scss index aba10f7..7f2d55d 100644 --- a/scss/tests/files/general/css-calc.scss +++ b/scss/tests/files/general/css-calc.scss @@ -1,3 +1,5 @@ p { + width: -moz-calc(100% - 10px); + width: -webkit-calc(100% - 10px); width: calc(100% - 10px); } |