Skip to content

Commit

Permalink
support added for css variables (#1633)
Browse files Browse the repository at this point in the history
* support added for css variables

* [-]+ instead of [-]*
  • Loading branch information
zjeffer committed Jan 10, 2021
1 parent f357435 commit c83fe48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pygments/lexers/css.py
Expand Up @@ -310,6 +310,8 @@ class CssLexer(RegexLexer):
(words(_vendor_prefixes,), Keyword.Pseudo),
(r'('+r'|'.join(_css_properties)+r')(\s*)(\:)',
bygroups(Keyword, Text, Punctuation), 'value-start'),
(r'([-]+[a-zA-Z_][\w-]*)(\s*)(\:)', bygroups(Name.Variable, Text, Punctuation),
'value-start'),
(r'([a-zA-Z_][\w-]*)(\s*)(\:)', bygroups(Name, Text, Punctuation),
'value-start'),

Expand Down Expand Up @@ -343,6 +345,7 @@ class CssLexer(RegexLexer):
],
'function-start': [
(r'\s+', Text),
(r'[-]+([\w+]+[-]*)+', Name.Variable),
include('urls'),
(words(_vendor_prefixes,), Keyword.Pseudo),
(words(_keyword_values, suffix=r'\b'), Keyword.Constant),
Expand Down

0 comments on commit c83fe48

Please sign in to comment.