|
31 | 31 | },
|
32 | 32 | {
|
33 | 33 | "include": "#rule-list"
|
| 34 | + }, |
| 35 | + { |
| 36 | + "include": "#nesting-selector" |
34 | 37 | }
|
35 | 38 | ],
|
36 | 39 | "repository": {
|
|
224 | 227 | },
|
225 | 228 | "name": "meta.at-rule.media.body.css",
|
226 | 229 | "patterns": [
|
| 230 | + { |
| 231 | + "include": "#nesting-at-rules" |
| 232 | + }, |
227 | 233 | {
|
228 | 234 | "include": "$self"
|
229 | 235 | }
|
|
506 | 512 | },
|
507 | 513 | "name": "meta.at-rule.supports.body.css",
|
508 | 514 | "patterns": [
|
| 515 | + { |
| 516 | + "include": "#nesting-at-rules" |
| 517 | + }, |
509 | 518 | {
|
510 | 519 | "include": "$self"
|
511 | 520 | }
|
|
1379 | 1388 | },
|
1380 | 1389 | "match": "(?xi)\n(?<=^|\\s|,|\\*/)\n(?:\n # Valid media types\n (all|print|screen|speech)\n |\n # Deprecated in Media Queries 4: http://dev.w3.org/csswg/mediaqueries/#media-types\n (aural|braille|embossed|handheld|projection|tty|tv)\n)\n(?=$|[{,\\s;]|/\\*)"
|
1381 | 1390 | },
|
| 1391 | + "nesting-at-rules": { |
| 1392 | + "patterns": [ |
| 1393 | + { |
| 1394 | + "include": "#commas" |
| 1395 | + }, |
| 1396 | + { |
| 1397 | + "include": "#nesting-rules" |
| 1398 | + }, |
| 1399 | + { |
| 1400 | + "include": "#rule-list-innards" |
| 1401 | + } |
| 1402 | + ] |
| 1403 | + }, |
| 1404 | + "nesting-rules": { |
| 1405 | + "patterns": [ |
| 1406 | + { |
| 1407 | + "match": "(?xi) (?<![\\w:-])\n(?:\n header|label|mark|nav|ruby|span\n)\n(?=[+~>\\s,.\\#|&){:\\[]|/\\*|$)", |
| 1408 | + "name": "entity.name.tag.css" |
| 1409 | + }, |
| 1410 | + { |
| 1411 | + "include": "#property-names" |
| 1412 | + }, |
| 1413 | + { |
| 1414 | + "include": "#selector-innards" |
| 1415 | + } |
| 1416 | + ] |
| 1417 | + }, |
| 1418 | + "nesting-selector": { |
| 1419 | + "match": "&", |
| 1420 | + "name": "entity.name.tag.nesting.selector.css" |
| 1421 | + }, |
1382 | 1422 | "numeric-values": {
|
1383 | 1423 | "patterns": [
|
1384 | 1424 | {
|
|
1510 | 1550 | },
|
1511 | 1551 | "name": "meta.property-list.css",
|
1512 | 1552 | "patterns": [
|
| 1553 | + { |
| 1554 | + "include": "#nesting-rules" |
| 1555 | + }, |
1513 | 1556 | {
|
1514 | 1557 | "include": "#rule-list-innards"
|
| 1558 | + }, |
| 1559 | + { |
| 1560 | + "include": "$self" |
1515 | 1561 | }
|
1516 | 1562 | ]
|
1517 | 1563 | },
|
|
1581 | 1627 | },
|
1582 | 1628 | "selector-innards": {
|
1583 | 1629 | "patterns": [
|
| 1630 | + { |
| 1631 | + "include": "#nesting-selector" |
| 1632 | + }, |
1584 | 1633 | {
|
1585 | 1634 | "include": "#comment-block"
|
1586 | 1635 | },
|
|
1624 | 1673 | ]
|
1625 | 1674 | }
|
1626 | 1675 | },
|
1627 |
| - "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)", |
| 1676 | + "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)", |
1628 | 1677 | "name": "invalid.illegal.bad-identifier.css"
|
1629 | 1678 | },
|
1630 | 1679 | {
|
|
1640 | 1689 | ]
|
1641 | 1690 | }
|
1642 | 1691 | },
|
1643 |
| - "match": "(?x)\n(\\.) # Valid class-name\n(\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # Valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence\n )+\n) # Followed by either:\n(?= $ # - End of the line\n | [\\s,.\\#)\\[:{>+~|] # - Another selector\n | /\\* # - A block comment\n)", |
| 1692 | + "match": "(?x)\n(\\.) # Valid class-name\n(\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # Valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence\n )+\n) # Followed by either:\n(?= $ # - End of the line\n | [\\s,.\\#)\\[:{>+~|&] # - Another selector\n | /\\* # - A block comment\n)", |
1644 | 1693 | "name": "entity.other.attribute-name.class.css"
|
1645 | 1694 | },
|
1646 | 1695 | {
|
|
1656 | 1705 | ]
|
1657 | 1706 | }
|
1658 | 1707 | },
|
1659 |
| - "match": "(?x)\n(\\#)\n(\n -?\n (?![0-9])\n (?:[-a-zA-Z0-9_]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+\n)\n(?=$|[\\s,.\\#)\\[:{>+~|]|/\\*)", |
| 1708 | + "match": "(?x)\n(\\#)\n(\n -?\n (?![0-9])\n (?:[-a-zA-Z0-9_]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+\n)\n(?=$|[\\s,.\\#)\\[:{>+~|&]|/\\*)", |
1660 | 1709 | "name": "entity.other.attribute-name.id.css"
|
1661 | 1710 | },
|
1662 | 1711 | {
|
|
1820 | 1869 | ]
|
1821 | 1870 | },
|
1822 | 1871 | "tag-names": {
|
1823 |
| - "match": "(?xi) (?<![\\w:-])\n(?:\n # HTML\n a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound\n | big|blink|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command\n | content|data|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|element|em|embed|fieldset\n | figcaption|figure|font|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i\n | iframe|image|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark\n | marquee|math|menu|menuitem|meta|meter|multicol|nav|nextid|nobr|noembed|noframes|noscript\n | object|ol|optgroup|option|output|p|param|picture|plaintext|pre|progress|q|rb|rp|rt|rtc\n | ruby|s|samp|script|section|select|shadow|slot|small|source|spacer|span|strike|strong\n | style|sub|summary|sup|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr\n | track|tt|u|ul|var|video|wbr|xmp\n\n # SVG\n | altGlyph|altGlyphDef|altGlyphItem|animate|animateColor|animateMotion|animateTransform\n | circle|clipPath|color-profile|cursor|defs|desc|discard|ellipse|feBlend|feColorMatrix\n | feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap\n | feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur\n | feImage|feMerge|feMergeNode|feMorphology|feOffset|fePointLight|feSpecularLighting\n | feSpotLight|feTile|feTurbulence|filter|font-face|font-face-format|font-face-name\n | font-face-src|font-face-uri|foreignObject|g|glyph|glyphRef|hatch|hatchpath|hkern\n | line|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|metadata\n | missing-glyph|mpath|path|pattern|polygon|polyline|radialGradient|rect|set|solidcolor\n | stop|svg|switch|symbol|text|textPath|tref|tspan|use|view|vkern\n\n # MathML\n | annotation|annotation-xml|maction|maligngroup|malignmark|math|menclose|merror|mfenced\n | mfrac|mglyph|mi|mlabeledtr|mlongdiv|mmultiscripts|mn|mo|mover|mpadded|mphantom|mroot\n | mrow|ms|mscarries|mscarry|msgroup|msline|mspace|msqrt|msrow|mstack|mstyle|msub|msubsup\n | msup|mtable|mtd|mtext|mtr|munder|munderover|semantics\n)\n(?=[+~>\\s,.\\#|){:\\[]|/\\*|$)", |
| 1872 | + "match": "(?xi) (?<![\\w:-])\n(?:\n # HTML\n a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound\n | big|blink|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command\n | content|data|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|element|em|embed|fieldset\n | figcaption|figure|font|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i\n | iframe|image|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark\n | marquee|math|menu|menuitem|meta|meter|multicol|nav|nextid|nobr|noembed|noframes|noscript\n | object|ol|optgroup|option|output|p|param|picture|plaintext|pre|progress|q|rb|rp|rt|rtc\n | ruby|s|samp|script|section|select|shadow|slot|small|source|spacer|span|strike|strong\n | style|sub|summary|sup|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr\n | track|tt|u|ul|var|video|wbr|xmp\n\n # SVG\n | altGlyph|altGlyphDef|altGlyphItem|animate|animateColor|animateMotion|animateTransform\n | circle|clipPath|color-profile|cursor|defs|desc|discard|ellipse|feBlend|feColorMatrix\n | feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap\n | feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur\n | feImage|feMerge|feMergeNode|feMorphology|feOffset|fePointLight|feSpecularLighting\n | feSpotLight|feTile|feTurbulence|filter|font-face|font-face-format|font-face-name\n | font-face-src|font-face-uri|foreignObject|g|glyph|glyphRef|hatch|hatchpath|hkern\n | line|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|metadata\n | missing-glyph|mpath|path|pattern|polygon|polyline|radialGradient|rect|set|solidcolor\n | stop|svg|switch|symbol|text|textPath|tref|tspan|use|view|vkern\n\n # MathML\n | annotation|annotation-xml|maction|maligngroup|malignmark|math|menclose|merror|mfenced\n | mfrac|mglyph|mi|mlabeledtr|mlongdiv|mmultiscripts|mn|mo|mover|mpadded|mphantom|mroot\n | mrow|ms|mscarries|mscarry|msgroup|msline|mspace|msqrt|msrow|mstack|mstyle|msub|msubsup\n | msup|mtable|mtd|mtext|mtr|munder|munderover|semantics\n)\n(?=[+~>\\s,.\\#|&){:\\[]|/\\*|$)", |
1824 | 1873 | "name": "entity.name.tag.css"
|
1825 | 1874 | },
|
1826 | 1875 | "unicode-range": {
|
|
0 commit comments