|
791 | 791 | { |
792 | 792 | "include": "#escapes" |
793 | 793 | }, |
794 | | - { |
795 | | - "match": "(?xi)\n (?<=not.*)not\n # Only one `not` in allowed", |
| 794 | + { |
| 795 | + "match": "(?xi)\n (?<=not.*)not\n # Only one `not` in allowed", |
796 | 796 | "name": "invalid.illegal.multiple-not.container.css" |
797 | | - }, |
| 797 | + }, |
798 | 798 | { |
799 | 799 | "match": "(?i)(?<=\\s|^|,|\\*/)(and|or|not)(?=\\s|{|/\\*|$)", |
800 | 800 | "name": "keyword.operator.logical.$1.container.css" |
801 | 801 | }, |
802 | 802 | { |
803 | 803 | "include": "#container-name" |
804 | 804 | }, |
805 | | - { |
| 805 | + { |
806 | 806 | "include": "#container-query" |
807 | 807 | } |
808 | 808 | ] |
809 | 809 | }, |
810 | 810 | "container-name": { |
811 | | - "begin": "\\G", |
| 811 | + "begin": "\\G", |
812 | 812 | "end": "(?xi)\n (?=(?:\\(|not)|style\\()\n # Ends when `(`, `not`, or `style(` is reached", |
813 | | - "patterns": [ |
814 | | - { |
| 813 | + "patterns": [ |
| 814 | + { |
815 | 815 | "include": "#comment-block" |
816 | 816 | }, |
817 | | - { |
818 | | - "captures": { |
819 | | - "1": { |
820 | | - "name": "invalid.illegal.constant.container-name.container.css" |
821 | | - }, |
822 | | - "2": { |
823 | | - "name": "support.constant.container-name.container.css" |
824 | | - } |
825 | | - }, |
826 | | - "match": "(?xi)\n (?<=^|\\s|\\*/)\n(?:\n # Invalid name\n (default|none)\n |\n # Valid names\n ([a-zA-Z0-9\\-_\\\\]+)\n )\n(?=$|[({\\s;]|/\\*)" |
827 | | - } |
828 | | - ] |
| 817 | + { |
| 818 | + "captures": { |
| 819 | + "1": { |
| 820 | + "name": "invalid.illegal.constant.container-name.container.css" |
| 821 | + }, |
| 822 | + "2": { |
| 823 | + "name": "support.constant.container-name.container.css" |
| 824 | + } |
| 825 | + }, |
| 826 | + "match": "(?xi)\n (?<=^|\\s|\\*/)\n(?:\n # Invalid name\n (default|none)\n |\n # Valid names\n ([a-zA-Z0-9\\-_\\\\]+)\n )\n(?=$|[({\\s;]|/\\*)" |
| 827 | + } |
| 828 | + ] |
829 | 829 | }, |
830 | | - "container-query": { |
| 830 | + "container-query": { |
831 | 831 | "begin": "((?<=\\s)\\()|(style)(\\()", |
832 | 832 | "beginCaptures": { |
833 | | - "1": { |
| 833 | + "1": { |
834 | 834 | "name": "punctuation.definition.parameters.begin.bracket.round.css" |
835 | 835 | }, |
836 | | - "2": { |
| 836 | + "2": { |
837 | 837 | "name": "support.style-query.container.css" |
838 | 838 | }, |
839 | | - "3": { |
| 839 | + "3": { |
840 | 840 | "name": "punctuation.definition.parameters.begin.bracket.round.css" |
841 | 841 | } |
842 | 842 | }, |
|
847 | 847 | } |
848 | 848 | }, |
849 | 849 | "patterns": [ |
850 | | - { |
851 | | - "begin": "(?xi)\n (?<=\\s\\()\n # Rules for size <container-query>", |
852 | | - "end": "(?=\\))", |
853 | | - "patterns": [ |
854 | | - { |
855 | | - "include": "#container-query-features" |
856 | | - }, |
857 | | - { |
858 | | - "include": "#container-size-features" |
859 | | - }, |
860 | | - { |
861 | | - "include": "#container-size-feature-keywords" |
862 | | - } |
863 | | - ] |
864 | | - }, |
865 | | - { |
866 | | - "begin": "(?xi)\n (?<=style\\()\n # Rules for container-query <style-query>", |
867 | | - "end": "(?=\\))", |
868 | | - "name": "style-query.container.css", |
869 | | - "patterns": [ |
870 | | - { |
871 | | - "include": "#container-query-features" |
872 | | - }, |
873 | | - { |
874 | | - "include": "#container-style-features" |
875 | | - }, |
876 | | - { |
877 | | - "include": "#container-style-feature-keywords" |
878 | | - } |
879 | | - ] |
| 850 | + { |
| 851 | + "begin": "(?xi)\n (?<=\\s\\()\n # Rules for size <container-query>", |
| 852 | + "end": "(?=\\))", |
| 853 | + "patterns": [ |
| 854 | + { |
| 855 | + "include": "#container-query-features" |
| 856 | + }, |
| 857 | + { |
| 858 | + "include": "#container-size-features" |
| 859 | + }, |
| 860 | + { |
| 861 | + "include": "#container-size-feature-keywords" |
| 862 | + } |
| 863 | + ] |
| 864 | + }, |
| 865 | + { |
| 866 | + "begin": "(?xi)\n (?<=style\\()\n # Rules for container-query <style-query>", |
| 867 | + "end": "(?=\\))", |
| 868 | + "name": "style-query.container.css", |
| 869 | + "patterns": [ |
| 870 | + { |
| 871 | + "include": "#container-query-features" |
| 872 | + }, |
| 873 | + { |
| 874 | + "include": "#container-style-features" |
| 875 | + }, |
| 876 | + { |
| 877 | + "include": "#container-style-feature-keywords" |
| 878 | + } |
| 879 | + ] |
| 880 | + } |
| 881 | + ] |
| 882 | + }, |
| 883 | + "container-query-features": { |
| 884 | + "patterns": [ |
| 885 | + { |
| 886 | + "match": ":", |
| 887 | + "name": "punctuation.separator.key-value.css" |
| 888 | + }, |
| 889 | + { |
| 890 | + "match": ">=|<=|=|<|>", |
| 891 | + "name": "keyword.operator.comparison.css" |
| 892 | + }, |
| 893 | + { |
| 894 | + "include": "#numeric-values" |
| 895 | + }, |
| 896 | + { |
| 897 | + "include": "#comment-block" |
880 | 898 | } |
881 | 899 | ] |
882 | 900 | }, |
883 | | - "container-query-features": { |
884 | | - "patterns": [ |
885 | | - { |
886 | | - "match": ":", |
887 | | - "name": "punctuation.separator.key-value.css" |
888 | | - }, |
889 | | - { |
890 | | - "match": ">=|<=|=|<|>", |
891 | | - "name": "keyword.operator.comparison.css" |
892 | | - }, |
893 | | - { |
894 | | - "include": "#numeric-values" |
895 | | - }, |
896 | | - { |
897 | | - "include": "#comment-block" |
898 | | - } |
899 | | - ] |
900 | | - }, |
901 | 901 | "container-size-features": { |
902 | | - "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", |
| 902 | + "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", |
903 | 903 | "name": "support.size.property-name.container.css" |
904 | 904 | }, |
905 | | - "container-size-feature-keywords": { |
906 | | - "patterns": [ |
907 | | - { |
908 | | - "match": "(?xi)\n (?<=^|\\s|:|\\*/)\n # Preceded by whitespace, colon, or comment\n (?: portrait\n | landscape\n # Orientation\n )\n (?=\\s|\\)|$)", |
909 | | - "name": "support.constant.property-value.container.css" |
910 | | - }, |
911 | | - { |
912 | | - "include": "#functions" |
913 | | - } |
914 | | - ] |
915 | | - }, |
916 | | - "container-style-features": { |
917 | | - "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)*", |
| 905 | + "container-size-feature-keywords": { |
| 906 | + "patterns": [ |
| 907 | + { |
| 908 | + "match": "(?xi)\n (?<=^|\\s|:|\\*/)\n # Preceded by whitespace, colon, or comment\n (?: portrait\n | landscape\n # Orientation\n )\n (?=\\s|\\)|$)", |
| 909 | + "name": "support.constant.property-value.container.css" |
| 910 | + }, |
| 911 | + { |
| 912 | + "include": "#functions" |
| 913 | + } |
| 914 | + ] |
| 915 | + }, |
| 916 | + "container-style-features": { |
| 917 | + "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)*", |
918 | 918 | "name": "variable.style-query.container.css" |
919 | | - }, |
920 | | - "container-style-feature-keywords": { |
921 | | - "begin": "(?xi)\n (?<=[\\:\\s*|\\*/])\n # Preceded by colon and zero or more whitespaces, or a comment \n (?:(?!\\s)) # Ignore trailing whitespace", |
922 | | - "end": "(?=[\\s|\\)|$])", |
923 | | - "patterns": [ |
924 | | - { |
925 | | - "match": "(true|false)", |
926 | | - "name": "support.constant.boolean.container.css" |
927 | | - }, |
928 | | - { |
| 919 | + }, |
| 920 | + "container-style-feature-keywords": { |
| 921 | + "begin": "(?xi)\n (?<=[\\:\\s*|\\*/])\n # Preceded by colon and zero or more whitespaces, or a comment \n (?:(?!\\s)) # Ignore trailing whitespace", |
| 922 | + "end": "(?=[\\s|\\)|$])", |
| 923 | + "patterns": [ |
| 924 | + { |
| 925 | + "match": "(true|false)", |
| 926 | + "name": "support.constant.boolean.container.css" |
| 927 | + }, |
| 928 | + { |
929 | 929 | "include": "#functions" |
930 | 930 | }, |
931 | 931 | { |
|
937 | 937 | { |
938 | 938 | "include": "#color-keywords" |
939 | 939 | } |
940 | | - ] |
941 | | - }, |
| 940 | + ] |
| 941 | + }, |
942 | 942 | "escapes": { |
943 | 943 | "patterns": [ |
944 | 944 | { |
|
0 commit comments