|
34 | 34 | {
|
35 | 35 | 'include': '#rule-list'
|
36 | 36 | }
|
37 |
| - { |
38 |
| - 'include': '#nesting-selector' |
39 |
| - } |
40 | 37 | ]
|
41 | 38 | 'repository':
|
42 |
| - 'arithmetic-operators': |
43 |
| - 'match': '[*/]|(?<=\\s|^)[-+](?=\\s|$)' |
44 |
| - 'name': 'keyword.operator.arithmetic.css' |
45 | 39 | 'at-rules':
|
46 | 40 | 'patterns': [
|
47 | 41 | {
|
|
220 | 214 | 'name': 'punctuation.section.media.end.bracket.curly.css'
|
221 | 215 | 'name': 'meta.at-rule.media.body.css'
|
222 | 216 | 'patterns': [
|
223 |
| - { |
224 |
| - 'include': '#nesting-at-rules' |
225 |
| - } |
226 | 217 | {
|
227 | 218 | 'include': '$self'
|
228 | 219 | }
|
|
641 | 632 | 'name': 'punctuation.section.end.bracket.curly.css'
|
642 | 633 | 'name': 'meta.at-rule.body.css'
|
643 | 634 | 'patterns': [
|
644 |
| - { |
645 |
| - 'include': '#nesting-at-rules' |
646 |
| - } |
647 | 635 | {
|
648 | 636 | 'include': '$self'
|
649 | 637 | }
|
|
722 | 710 | '0':
|
723 | 711 | 'name': 'punctuation.definition.comment.end.css'
|
724 | 712 | 'name': 'comment.block.css'
|
725 |
| - 'container-condition': |
726 |
| - 'begin': '\\G' |
727 |
| - 'end': '(?=\\s*[{;])' |
728 |
| - 'patterns': [ |
729 |
| - { |
730 |
| - 'include': '#comment-block' |
731 |
| - } |
732 |
| - { |
733 |
| - 'include': '#escapes' |
734 |
| - } |
735 |
| - { |
736 |
| - 'match': '(?xi)\n (?<=not.*)not\n # Only one `not` in allowed' |
737 |
| - 'name': 'invalid.illegal.multiple-not.container.css' |
738 |
| - } |
739 |
| - { |
740 |
| - 'match': '(?i)(?<=\\s|^|,|\\*/)(and|or|not)(?=\\s|{|/\\*|$)' |
741 |
| - 'name': 'keyword.operator.logical.$1.container.css' |
742 |
| - } |
743 |
| - { |
744 |
| - 'include': '#container-name' |
745 |
| - } |
746 |
| - { |
747 |
| - 'include': '#container-query' |
748 |
| - } |
749 |
| - ] |
750 |
| - 'container-name': |
751 |
| - 'begin': '\\G' |
752 |
| - 'end': '(?xi)\n (?=(?:\\(|not)|style\\()\n # Ends when `(`, `not`, or `style(` is reached' |
753 |
| - 'patterns': [ |
754 |
| - { |
755 |
| - 'include': '#comment-block' |
756 |
| - } |
757 |
| - { |
758 |
| - 'captures': |
759 |
| - '1': |
760 |
| - 'name': 'invalid.illegal.constant.container-name.container.css' |
761 |
| - '2': |
762 |
| - 'name': 'support.constant.container-name.container.css' |
763 |
| - 'match': '(?xi)\n (?<=^|\\s|\\*/)\n(?:\n # Invalid name\n (default|none)\n |\n # Valid names\n ([a-zA-Z0-9\\-_\\\\]+)\n )\n(?=$|[({\\s;]|/\\*)' |
764 |
| - } |
765 |
| - ] |
766 |
| - 'container-query': |
767 |
| - 'begin': '((?<=\\s)\\()|(style)(\\()' |
768 |
| - 'beginCaptures': |
769 |
| - '1': |
770 |
| - 'name': 'punctuation.definition.parameters.begin.bracket.round.css' |
771 |
| - '2': |
772 |
| - 'name': 'support.style-query.container.css' |
773 |
| - '3': |
774 |
| - 'name': 'punctuation.definition.parameters.begin.bracket.round.css' |
775 |
| - 'end': '\\)' |
776 |
| - 'endCaptures': |
777 |
| - '0': |
778 |
| - 'name': 'punctuation.definition.parameters.end.bracket.round.css' |
779 |
| - 'patterns': [ |
780 |
| - { |
781 |
| - 'begin': '(?xi)\n (?<=\\s\\()\n # Rules for size <container-query>' |
782 |
| - 'end': '(?=\\))' |
783 |
| - 'patterns': [ |
784 |
| - { |
785 |
| - 'include': '#container-query-features' |
786 |
| - } |
787 |
| - { |
788 |
| - 'include': '#container-size-features' |
789 |
| - } |
790 |
| - { |
791 |
| - 'include': '#container-size-feature-keywords' |
792 |
| - } |
793 |
| - ] |
794 |
| - } |
795 |
| - { |
796 |
| - 'begin': '(?xi)\n (?<=style\\()\n # Rules for container-query <style-query>' |
797 |
| - 'end': '(?=\\))' |
798 |
| - 'name': 'style-query.container.css' |
799 |
| - 'patterns': [ |
800 |
| - { |
801 |
| - 'include': '#container-query-features' |
802 |
| - } |
803 |
| - { |
804 |
| - 'include': '#container-style-features' |
805 |
| - } |
806 |
| - { |
807 |
| - 'include': '#container-style-feature-keywords' |
808 |
| - } |
809 |
| - ] |
810 |
| - } |
811 |
| - ] |
812 |
| - 'container-query-features': |
813 |
| - 'patterns': [ |
814 |
| - { |
815 |
| - 'match': ':' |
816 |
| - 'name': 'punctuation.separator.key-value.css' |
817 |
| - } |
818 |
| - { |
819 |
| - 'match': '>=|<=|=|<|>' |
820 |
| - 'name': 'keyword.operator.comparison.css' |
821 |
| - } |
822 |
| - { |
823 |
| - 'include': '#numeric-values' |
824 |
| - } |
825 |
| - { |
826 |
| - 'include': '#comment-block' |
827 |
| - } |
828 |
| - ] |
829 |
| - 'container-size-features': |
830 |
| - 'match': '(?xi)\n (?<=^|\\s|\\(|\\*/) # Preceded by whitespace, bracket or comment\n (?:\n # Standardised features\n (\n (?:min-|max-)? # Range features\n (?: aspect-ratio\n | block-size\n | height\n | inline-size\n | width\n )\n | orientation\n )\n )\n (?=\\s|$|[><:=]|\\)|/\\*) # Terminates cleanly' |
831 |
| - 'name': 'support.size.property-name.container.css' |
832 |
| - 'container-size-feature-keywords': |
833 |
| - 'patterns': [ |
834 |
| - { |
835 |
| - 'match': '(?xi)\n (?<=^|\\s|:|\\*/)\n # Preceded by whitespace, colon, or comment\n (?: portrait\n | landscape\n # Orientation\n )\n (?=\\s|\\)|$)' |
836 |
| - 'name': 'support.constant.property-value.container.css' |
837 |
| - } |
838 |
| - { |
839 |
| - 'include': '#functions' |
840 |
| - } |
841 |
| - ] |
842 |
| - 'container-style-features': |
843 |
| - 'match': '(?x)\n # Custom Property Name\n (?<=^|\\s|\\(|\\*/) # Preceded by whitespace, bracket or comment\n (?<![\\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)*' |
844 |
| - 'name': 'variable.style-query.container.css' |
845 |
| - 'container-style-feature-keywords': |
846 |
| - 'begin': '(?xi)\n (?<=[\\:\\s*|\\*/])\n # Preceded by colon and zero or more whitespaces, or a comment \n (?:(?!\\s)) # Ignore trailing whitespace' |
847 |
| - 'end': '(?=[\\s|\\)|$])' |
848 |
| - 'patterns': [ |
849 |
| - { |
850 |
| - 'match': '(true|false)' |
851 |
| - 'name': 'support.constant.boolean.container.css' |
852 |
| - } |
853 |
| - { |
854 |
| - 'include': '#functions' |
855 |
| - } |
856 |
| - { |
857 |
| - 'include': '#property-keywords' |
858 |
| - } |
859 |
| - { |
860 |
| - 'include': '#unicode-range' |
861 |
| - } |
862 |
| - { |
863 |
| - 'include': '#color-keywords' |
864 |
| - } |
865 |
| - ] |
866 | 713 | 'escapes':
|
867 | 714 | 'patterns': [
|
868 | 715 | {
|
|
971 | 818 | 'name': 'meta.function.calc.css'
|
972 | 819 | 'patterns': [
|
973 | 820 | {
|
974 |
| - 'include': '#arithmetic-operators' |
| 821 | + 'match': '[*/]|(?<=\\s|^)[-+](?=\\s|$)' |
| 822 | + 'name': 'keyword.operator.arithmetic.css' |
975 | 823 | }
|
976 | 824 | {
|
977 | 825 | 'include': '#property-values'
|
978 | 826 | }
|
979 |
| - { |
980 |
| - 'include': '#function-nesting' |
981 |
| - } |
982 | 827 | ]
|
983 | 828 | }
|
984 | 829 | # Colours
|
985 | 830 | {
|
986 |
| - 'begin': '(?i)(?<![\\w-])(rgba?|rgb|hsla?|hsl|hwb|lab|oklab|lch|oklch|color|light-dark)(\\()' |
| 831 | + 'begin': '(?i)(?<![\\w-])(rgba?|rgb|hsla?|hsl|hwb|lab|oklab|lch|oklch|color)(\\()' |
987 | 832 | 'beginCaptures':
|
988 | 833 | '1':
|
989 | 834 | 'name': 'support.function.misc.css'
|
|
1092 | 937 | 'match': '(?i)(?<=[,\\s"]|\\*/|^)\\d+x(?=[\\s,"\')]|/\\*|$)'
|
1093 | 938 | 'name': 'constant.numeric.other.density.css'
|
1094 | 939 | }
|
1095 |
| - { |
1096 |
| - 'include': '#arithmetic-operators' |
1097 |
| - } |
1098 | 940 | {
|
1099 | 941 | 'include': '#property-values'
|
1100 | 942 | }
|
|
1208 | 1050 | ]
|
1209 | 1051 | }
|
1210 | 1052 | ]
|
1211 |
| - 'function-nesting': |
1212 |
| - 'patterns': [ |
1213 |
| - { |
1214 |
| - 'begin': '\\(' |
1215 |
| - 'beginCaptures': |
1216 |
| - '0': |
1217 |
| - 'name': 'punctuation.definition.begin.bracket.round.scss' |
1218 |
| - 'end': '\\)' |
1219 |
| - 'endCaptures': |
1220 |
| - '0': |
1221 |
| - 'name': 'punctuation.definition.end.bracket.round.scss' |
1222 |
| - 'patterns': [ |
1223 |
| - { |
1224 |
| - 'include': '#arithmetic-operators' |
1225 |
| - } |
1226 |
| - { |
1227 |
| - 'include': '#property-values' |
1228 |
| - }, |
1229 |
| - { |
1230 |
| - 'include': '#function-nesting' |
1231 |
| - } |
1232 |
| - ] |
1233 |
| - } |
1234 |
| - ] |
1235 | 1053 | 'functional-pseudo-classes':
|
1236 | 1054 | 'patterns': [
|
1237 | 1055 | {
|
|
1534 | 1352 | {
|
1535 | 1353 | 'include': '#comment-block'
|
1536 | 1354 | }
|
1537 |
| - { |
1538 |
| - "include": "#functions" |
1539 |
| - } |
1540 | 1355 | ]
|
1541 | 1356 | }
|
1542 | 1357 | ]
|
|
1565 | 1380 | )
|
1566 | 1381 | (?=$|[{,\\s;]|/\\*)
|
1567 | 1382 | '''
|
1568 |
| - 'nesting-at-rules': |
1569 |
| - 'patterns': [ |
1570 |
| - { |
1571 |
| - 'include': '#commas' |
1572 |
| - } |
1573 |
| - { |
1574 |
| - 'include': '#nesting-rules' |
1575 |
| - } |
1576 |
| - { |
1577 |
| - 'include': '#rule-list-innards' |
1578 |
| - } |
1579 |
| - ] |
1580 |
| - 'nesting-rules': |
1581 |
| - 'patterns': [ |
1582 |
| - { |
1583 |
| - 'match': '(?xi) (?<![\\w:-])\n(?:\n header|label|mark|nav|ruby|span\n)\n(?=[+~>\\s,.\\#|&){:\\[]|/\\*|$)' |
1584 |
| - 'name': 'entity.name.tag.css' |
1585 |
| - } |
1586 |
| - { |
1587 |
| - # Custom properties |
1588 |
| - 'match': '''(?x) (?<![\\w-]) |
1589 |
| - -- |
1590 |
| - (?:[-a-zA-Z_] | [^\\x00-\\x7F]) # First letter |
1591 |
| - (?:[-a-zA-Z0-9_] | [^\\x00-\\x7F] # Remainder of identifier |
1592 |
| - |\\\\(?:[0-9a-fA-F]{1,6}|.) |
1593 |
| - )* |
1594 |
| - ''' |
1595 |
| - 'name': 'variable.css' |
1596 |
| - } |
1597 |
| - { |
1598 |
| - 'begin': '(?<![-a-zA-Z])(?=[-a-zA-Z])' |
1599 |
| - 'end': '$|(?![-a-zA-Z])' |
1600 |
| - 'name': 'meta.property-name.css' |
1601 |
| - 'patterns': [ |
1602 |
| - { |
1603 |
| - 'include': '#property-names' |
1604 |
| - } |
1605 |
| - ] |
1606 |
| - } |
1607 |
| - |
1608 |
| - { |
1609 |
| - 'include': '#selector-innards' |
1610 |
| - } |
1611 |
| - ] |
1612 |
| - 'nesting-selector': |
1613 |
| - 'match': '&' |
1614 |
| - 'name': 'entity.name.tag.nesting.selector.css' |
1615 | 1383 | 'numeric-values':
|
1616 | 1384 | 'patterns': [
|
1617 | 1385 | {
|
|
1915 | 1683 | 'name': 'punctuation.section.property-list.end.bracket.curly.css'
|
1916 | 1684 | 'name': 'meta.property-list.css'
|
1917 | 1685 | 'patterns': [
|
1918 |
| - { |
1919 |
| - 'include': '#nesting-rules' |
1920 |
| - } |
1921 | 1686 | {
|
1922 | 1687 | 'include': '#rule-list-innards'
|
1923 | 1688 | }
|
1924 |
| - { |
1925 |
| - 'include': '$self' |
1926 |
| - } |
1927 | 1689 | ]
|
1928 | 1690 | 'rule-list-innards':
|
1929 | 1691 | 'patterns': [
|
|
2004 | 1766 | ]
|
2005 | 1767 | 'selector-innards':
|
2006 | 1768 | 'patterns': [
|
2007 |
| - { |
2008 |
| - 'include': '#nesting-selector' |
2009 |
| - } |
2010 | 1769 | {
|
2011 | 1770 | 'include': '#comment-block'
|
2012 | 1771 | }
|
|
2074 | 1833 | # Consists of a hyphen only
|
2075 | 1834 | - # Terminated by either:
|
2076 | 1835 | (?= $ # - End-of-line
|
2077 |
| - | [\\s,.\\#)\\[:{>+~|&] # - Followed by another selector |
| 1836 | + | [\\s,.\\#)\\[:{>+~|] # - Followed by another selector |
2078 | 1837 | | /\\* # - Followed by a block comment
|
2079 | 1838 | )
|
2080 | 1839 | |
|
|
2084 | 1843 | | \\\\(?:[0-9a-fA-F]{1,6}|.) # - Escape sequence
|
2085 | 1844 | )*
|
2086 | 1845 | (?: # Invalid punctuation
|
2087 |
| - [!"'%(*;<?@^`|\\]}] # - NOTE: We exempt `)` from the list of checked |
| 1846 | + [!"'%&(*;<?@^`|\\]}] # - NOTE: We exempt `)` from the list of checked |
2088 | 1847 | | # symbols to avoid matching `:not(.invalid)`
|
2089 | 1848 | / (?!\\*) # - Avoid invalidating the start of a comment
|
2090 | 1849 | )+
|
|
2115 | 1874 | )+
|
2116 | 1875 | ) # Followed by either:
|
2117 | 1876 | (?= $ # - End of the line
|
2118 |
| - | [\\s,.\\#)\\[:{>+~|&] # - Another selector |
| 1877 | + | [\\s,.\\#)\\[:{>+~|] # - Another selector |
2119 | 1878 | | /\\* # - A block comment
|
2120 | 1879 | )
|
2121 | 1880 | '''
|
|
2138 | 1897 | (?![0-9])
|
2139 | 1898 | (?:[-a-zA-Z0-9_]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+
|
2140 | 1899 | )
|
2141 |
| - (?=$|[\\s,.\\#)\\[:{>+~|&]|/\\*) |
| 1900 | + (?=$|[\\s,.\\#)\\[:{>+~|]|/\\*) |
2142 | 1901 | '''
|
2143 | 1902 | 'name': 'entity.other.attribute-name.id.css'
|
2144 | 1903 | }
|
|
2341 | 2100 | | mrow|ms|mscarries|mscarry|msgroup|msline|mspace|msqrt|msrow|mstack|mstyle|msub|msubsup
|
2342 | 2101 | | msup|mtable|mtd|mtext|mtr|munder|munderover|semantics
|
2343 | 2102 | )
|
2344 |
| - (?=[+~>\\s,.\\#|&){:\\[]|/\\*|$) |
| 2103 | + (?=[+~>\\s,.\\#|){:\\[]|/\\*|$) |
2345 | 2104 | '''
|
2346 | 2105 | 'name': 'entity.name.tag.css'
|
2347 | 2106 | 'unicode-range':
|
|
0 commit comments