Skip to content

Commit 82b957f

Browse files
committed
Passes tests starting point
1 parent c52c9d2 commit 82b957f

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/vscode-css/grammars/css.cson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@
983983
}
984984
# Colours
985985
{
986-
'begin': '(?i)(?<![\\w-])(rgba?|rgb|hsla?|hsl|hwb|lab|oklab|lch|oklch|color)(\\()'
986+
'begin': '(?i)(?<![\\w-])(rgba?|rgb|hsla?|hsl|hwb|lab|oklab|lch|oklch|color|light-dark)(\\()'
987987
'beginCaptures':
988988
'1':
989989
'name': 'support.function.misc.css'
@@ -2084,7 +2084,7 @@
20842084
| \\\\(?:[0-9a-fA-F]{1,6}|.) # - Escape sequence
20852085
)*
20862086
(?: # Invalid punctuation
2087-
[!"'%&(*;<?@^`|\\]}] # - NOTE: We exempt `)` from the list of checked
2087+
[!"'%(*;<?@^`|\\]}] # - NOTE: We exempt `)` from the list of checked
20882088
| # symbols to avoid matching `:not(.invalid)`
20892089
/ (?!\\*) # - Avoid invalidating the start of a comment
20902090
)+

syntaxes/css.tmLanguage.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@
10191019
]
10201020
},
10211021
{
1022-
"begin": "(?i)(?<![\\w-])(rgba?|rgb|hsla?|hsl|hwb|lab|oklab|lch|oklch|color)(\\()",
1022+
"begin": "(?i)(?<![\\w-])(rgba?|rgb|hsla?|hsl|hwb|lab|oklab|lch|oklch|color|light-dark)(\\()",
10231023
"beginCaptures": {
10241024
"1": {
10251025
"name": "support.function.misc.css"
@@ -1597,7 +1597,18 @@
15971597
"name": "entity.name.tag.css"
15981598
},
15991599
{
1600-
"include": "#property-names"
1600+
"match": "(?x) (?<![\\w-])\n--\n(?:[-a-zA-Z_] | [^\\x00-\\x7F]) # First letter\n(?:[-a-zA-Z0-9_] | [^\\x00-\\x7F] # Remainder of identifier\n |\\\\(?:[0-9a-fA-F]{1,6}|.)\n)*",
1601+
"name": "variable.css"
1602+
},
1603+
{
1604+
"begin": "(?<![-a-zA-Z])(?=[-a-zA-Z])",
1605+
"end": "$|(?![-a-zA-Z])",
1606+
"name": "meta.property-name.css",
1607+
"patterns": [
1608+
{
1609+
"include": "#property-names"
1610+
}
1611+
]
16011612
},
16021613
{
16031614
"include": "#selector-innards"
@@ -1862,7 +1873,7 @@
18621873
]
18631874
}
18641875
},
1865-
"match": "(?x) (?<![@\\w-])\n([.\\#])\n# Invalid identifier\n(\n (?:\n # Starts with ASCII digits, with possible hyphen preceding it\n -?[0-9]\n |\n # Consists of a hyphen only\n - # Terminated by either:\n (?= $ # - End-of-line\n | [\\s,.\\#)\\[:{>+~|&] # - Followed by another selector\n | /\\* # - Followed by a block comment\n )\n |\n # Name contains unescaped ASCII symbol\n (?: # Check for acceptable preceding characters\n [-a-zA-Z_0-9]|[^\\x00-\\x7F] # - Valid selector character\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # - Escape sequence\n )*\n (?: # Invalid punctuation\n [!\"'%&(*;<?@^`|\\]}] # - NOTE: We exempt `)` from the list of checked\n | # symbols to avoid matching `:not(.invalid)`\n / (?!\\*) # - Avoid invalidating the start of a comment\n )+\n )\n # Mark remainder of selector invalid\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # - Otherwise valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # - Escape sequence\n )*\n)",
1876+
"match": "(?x) (?<![@\\w-])\n([.\\#])\n# Invalid identifier\n(\n (?:\n # Starts with ASCII digits, with possible hyphen preceding it\n -?[0-9]\n |\n # Consists of a hyphen only\n - # Terminated by either:\n (?= $ # - End-of-line\n | [\\s,.\\#)\\[:{>+~|&] # - Followed by another selector\n | /\\* # - Followed by a block comment\n )\n |\n # Name contains unescaped ASCII symbol\n (?: # Check for acceptable preceding characters\n [-a-zA-Z_0-9]|[^\\x00-\\x7F] # - Valid selector character\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # - Escape sequence\n )*\n (?: # Invalid punctuation\n [!\"'%(*;<?@^`|\\]}] # - NOTE: We exempt `)` from the list of checked\n | # symbols to avoid matching `:not(.invalid)`\n / (?!\\*) # - Avoid invalidating the start of a comment\n )+\n )\n # Mark remainder of selector invalid\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # - Otherwise valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # - Escape sequence\n )*\n)",
18661877
"name": "invalid.illegal.bad-identifier.css"
18671878
},
18681879
{

0 commit comments

Comments
 (0)