Skip to content

Commit 7057054

Browse files
committed
Add & nesting selector
1 parent fa70ca1 commit 7057054

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/vscode-css/grammars/css.cson

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@
17931793
[-\\w*]+
17941794
\\|
17951795
(?!
1796-
[-\\[:.*\\#a-zA-Z_] # Make sure there's a selector to match
1796+
[-\\[:.*&\\#a-zA-Z_] # Make sure there's a selector to match
17971797
| [^\\x00-\\x7F]
17981798
)
17991799
)
@@ -1811,6 +1811,10 @@
18111811
{
18121812
'include': '#tag-names'
18131813
}
1814+
{
1815+
'match': '&'
1816+
'name': 'entity.name.tag.nesting.css'
1817+
}
18141818
{
18151819
'match': '\\*'
18161820
'name': 'entity.name.tag.wildcard.css'
@@ -1836,7 +1840,7 @@
18361840
# Consists of a hyphen only
18371841
- # Terminated by either:
18381842
(?= $ # - End-of-line
1839-
| [\\s,.\\#)\\[:{>+~|] # - Followed by another selector
1843+
| [\\s,.\\#)\\[:{>+~|&] # - Followed by another selector
18401844
| /\\* # - Followed by a block comment
18411845
)
18421846
|
@@ -1846,7 +1850,7 @@
18461850
| \\\\(?:[0-9a-fA-F]{1,6}|.) # - Escape sequence
18471851
)*
18481852
(?: # Invalid punctuation
1849-
[!"'%&(*;<?@^`|\\]}] # - NOTE: We exempt `)` from the list of checked
1853+
[!"'%(*;<?@^`|\\]}] # - NOTE: We exempt `)` from the list of checked
18501854
| # symbols to avoid matching `:not(.invalid)`
18511855
/ (?!\\*) # - Avoid invalidating the start of a comment
18521856
)+
@@ -1877,7 +1881,7 @@
18771881
)+
18781882
) # Followed by either:
18791883
(?= $ # - End of the line
1880-
| [\\s,.\\#)\\[:{>+~|] # - Another selector
1884+
| [\\s,.\\#)\\[:{>+~|&] # - Another selector
18811885
| /\\* # - A block comment
18821886
)
18831887
'''
@@ -1900,7 +1904,7 @@
19001904
(?![0-9])
19011905
(?:[-a-zA-Z0-9_]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+
19021906
)
1903-
(?=$|[\\s,.\\#)\\[:{>+~|]|/\\*)
1907+
(?=$|[\\s,.\\#)\\[:{>+~|&]|/\\*)
19041908
'''
19051909
'name': 'entity.other.attribute-name.id.css'
19061910
}
@@ -2103,7 +2107,7 @@
21032107
| mrow|ms|mscarries|mscarry|msgroup|msline|mspace|msqrt|msrow|mstack|mstyle|msub|msubsup
21042108
| msup|mtable|mtd|mtext|mtr|munder|munderover|semantics
21052109
)
2106-
(?=[+~>\\s,.\\#|){:\\[]|/\\*|$)
2110+
(?=[+~>\\s,.\\#|&){:\\[]|/\\*|$)
21072111
'''
21082112
'name': 'entity.name.tag.css'
21092113
'unicode-range':

0 commit comments

Comments
 (0)