{ "information_for_contributors": [ "This file has been converted from https://github.com/microsoft/vscode-css/blob/master/grammars/css.cson", "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], "version": "https://github.com/microsoft/vscode-css/commit/a927fe2f73927bf5c25d0b0c4dd0e63d69fd8887", "name": "CSS", "scopeName": "source.css", "patterns": [ { "include": "#comment-block" }, { "include": "#escapes" }, { "include": "#combinators" }, { "include": "#selector" }, { "include": "#at-rules" }, { "include": "#rule-list" } ], "repository": { "at-rules": { "patterns": [ { "begin": "\\A(?:\\xEF\\xBB\\xBF)?(?i:(?=\\s*@charset\\b))", "end": ";|(?=$)", "endCaptures": { "0": { "name": "punctuation.terminator.rule.css" } }, "name": "meta.at-rule.charset.css", "patterns": [ { "captures": { "1": { "name": "invalid.illegal.not-lowercase.charset.css" }, "2": { "name": "invalid.illegal.leading-whitespace.charset.css" }, "3": { "name": "invalid.illegal.no-whitespace.charset.css" }, "4": { "name": "invalid.illegal.whitespace.charset.css" }, "5": { "name": "invalid.illegal.not-double-quoted.charset.css" }, "6": { "name": "invalid.illegal.unclosed-string.charset.css" }, "7": { "name": "invalid.illegal.unexpected-characters.charset.css" } }, "match": "(?x) # Possible errors:\n\\G\n((?!@charset)@\\w+) # Not lowercase (@charset is case-sensitive)\n|\n\\G(\\s+) # Preceding whitespace\n|\n(@charset\\S[^;]*) # No whitespace after @charset\n|\n(?<=@charset) # Before quoted charset name\n(\\x20{2,}|\\t+) # More than one space used, or a tab\n|\n(?<=@charset\\x20) # Beginning of charset name\n([^\";]+) # Not double-quoted\n|\n(\"[^\"]+$) # Unclosed quote\n|\n(?<=\") # After charset name\n([^;]+) # Unexpected junk instead of semicolon" }, { "captures": { "1": { "name": "keyword.control.at-rule.charset.css" }, "2": { "name": "punctuation.definition.keyword.css" } }, "match": "((@)charset)(?=\\s)" }, { "begin": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.css" } }, "end": "\"|$", "endCaptures": { "0": { "name": "punctuation.definition.string.end.css" } }, "name": "string.quoted.double.css", "patterns": [ { "begin": "(?:\\G|^)(?=(?:[^\"])+$)", "end": "$", "name": "invalid.illegal.unclosed.string.css" } ] } ] }, { "begin": "(?i)((@)import)(?:\\s+|$|(?=['\"]|/\\*))", "beginCaptures": { "1": { "name": "keyword.control.at-rule.import.css" }, "2": { "name": "punctuation.definition.keyword.css" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.terminator.rule.css" } }, "name": "meta.at-rule.import.css", "patterns": [ { "begin": "\\G\\s*(?=/\\*)", "end": "(?<=\\*/)\\s*", "patterns": [ { "include": "#comment-block" } ] }, { "include": "#string" }, { "include": "#url" }, { "include": "#media-query-list" } ] }, { "begin": "(?i)((@)font-face)(?=\\s*|{|/\\*|$)", "beginCaptures": { "1": { "name": "keyword.control.at-rule.font-face.css" }, "2": { "name": "punctuation.definition.keyword.css" } }, "end": "(?!\\G)", "name": "meta.at-rule.font-face.css", "patterns": [ { "include": "#comment-block" }, { "include": "#escapes" }, { "include": "#rule-list" } ] }, { "begin": "(?i)(@)page(?=[\\s:{]|/\\*|$)", "captures": { "0": { "name": "keyword.control.at-rule.page.css" }, "1": { "name": "punctuation.definition.keyword.css" } }, "end": "(?=\\s*($|[:{;]))", "name": "meta.at-rule.page.css", "patterns": [ { "include": "#rule-list" } ] }, { "begin": "(?i)(?=@media(\\s|\\(|/\\*|$))", "end": "(?<=})(?!\\G)", "patterns": [ { "begin": "(?i)\\G(@)media", "beginCaptures": { "0": { "name": "keyword.control.at-rule.media.css" }, "1": { "name": "punctuation.definition.keyword.css" } }, "end": "(?=\\s*[{;])", "name": "meta.at-rule.media.header.css", "patterns": [ { "include": "#media-query-list" } ] }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.media.begin.bracket.curly.css" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.section.media.end.bracket.curly.css" } }, "name": "meta.at-rule.media.body.css", "patterns": [ { "include": "$self" } ] } ] }, { "begin": "(?i)(?=@counter-style([\\s'\"{;]|/\\*|$))", "end": "(?<=})(?!\\G)", "patterns": [ { "begin": "(?i)\\G(@)counter-style", "beginCaptures": { "0": { "name": "keyword.control.at-rule.counter-style.css" }, "1": { "name": "punctuation.definition.keyword.css" } }, "end": "(?=\\s*{)", "name": "meta.at-rule.counter-style.header.css", "patterns": [ { "include": "#comment-block" }, { "include": "#escapes" }, { "captures": { "0": { "patterns": [ { "include": "#escapes" } ] } }, "match": "(?x)\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)*", "name": "variable.parameter.style-name.css" } ] }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.property-list.begin.bracket.curly.css" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.section.property-list.end.bracket.curly.css" } }, "name": "meta.at-rule.counter-style.body.css", "patterns": [ { "include": "#comment-block" }, { "include": "#escapes" }, { "include": "#rule-list-innards" } ] } ] }, { "begin": "(?i)(?=@document([\\s'\"{;]|/\\*|$))", "end": "(?<=})(?!\\G)", "patterns": [ { "begin": "(?i)\\G(@)document", "beginCaptures": { "0": { "name": "keyword.control.at-rule.document.css" }, "1": { "name": "punctuation.definition.keyword.css" } }, "end": "(?=\\s*[{;])", "name": "meta.at-rule.document.header.css", "patterns": [ { "begin": "(?i)(?>>", "name": "invalid.deprecated.combinator.css" }, { "match": ">>|>|\\+|~", "name": "keyword.operator.combinator.css" } ] }, "commas": { "match": ",", "name": "punctuation.separator.list.comma.css" }, "comment-block": { "begin": "/\\*", "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.css" } }, "end": "\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.end.css" } }, "name": "comment.block.css" }, "escapes": { "patterns": [ { "match": "\\\\[0-9a-fA-F]{1,6}", "name": "constant.character.escape.codepoint.css" }, { "begin": "\\\\$\\s*", "end": "^(?<:=]|\\)|/\\*) # Terminates cleanly" }, "media-feature-keywords": { "match": "(?xi)\n(?<=^|\\s|:|\\*/)\n(?: portrait # Orientation\n | landscape\n | progressive # Scan types\n | interlace\n | fullscreen # Display modes\n | standalone\n | minimal-ui\n | browser\n | hover\n)\n(?=\\s|\\)|$)", "name": "support.constant.property-value.css" }, "media-query": { "begin": "\\G", "end": "(?=\\s*[{;])", "patterns": [ { "include": "#comment-block" }, { "include": "#escapes" }, { "include": "#media-types" }, { "match": "(?i)(?<=\\s|^|,|\\*/)(only|not)(?=\\s|{|/\\*|$)", "name": "keyword.operator.logical.$1.media.css" }, { "match": "(?i)(?<=\\s|^|\\*/|\\))and(?=\\s|/\\*|$)", "name": "keyword.operator.logical.and.media.css" }, { "match": ",(?:(?:\\s*,)+|(?=\\s*[;){]))", "name": "invalid.illegal.comma.css" }, { "include": "#commas" }, { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.definition.parameters.begin.bracket.round.css" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.parameters.end.bracket.round.css" } }, "patterns": [ { "include": "#media-features" }, { "include": "#media-feature-keywords" }, { "match": ":", "name": "punctuation.separator.key-value.css" }, { "match": ">=|<=|=|<|>", "name": "keyword.operator.comparison.css" }, { "captures": { "1": { "name": "constant.numeric.css" }, "2": { "name": "keyword.operator.arithmetic.css" }, "3": { "name": "constant.numeric.css" } }, "match": "(\\d+)\\s*(/)\\s*(\\d+)", "name": "meta.ratio.css" }, { "include": "#numeric-values" }, { "include": "#comment-block" } ] } ] }, "media-query-list": { "begin": "(?=\\s*[^{;])", "end": "(?=\\s*[{;])", "patterns": [ { "include": "#media-query" } ] }, "media-types": { "captures": { "1": { "name": "support.constant.media.css" }, "2": { "name": "invalid.deprecated.constant.media.css" } }, "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;]|/\\*)" }, "numeric-values": { "patterns": [ { "captures": { "1": { "name": "punctuation.definition.constant.css" } }, "match": "(#)(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\\b", "name": "constant.other.color.rgb-value.hex.css" }, { "captures": { "1": { "name": "keyword.other.unit.percentage.css" }, "2": { "name": "keyword.other.unit.${2:/downcase}.css" } }, "match": "(?xi) (?+~|] # - 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 [!\"'%&(*;+~|] # - Another selector\n | /\\* # - A block comment\n)", "name": "entity.other.attribute-name.class.css" }, { "captures": { "1": { "name": "punctuation.definition.entity.css" }, "2": { "patterns": [ { "include": "#escapes" } ] } }, "match": "(?x)\n(\\#)\n(\n -?\n (?![0-9])\n (?:[-a-zA-Z0-9_]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+\n)\n(?=$|[\\s,.\\#)\\[:{>+~|]|/\\*)", "name": "entity.other.attribute-name.id.css" }, { "begin": "\\[", "beginCaptures": { "0": { "name": "punctuation.definition.entity.begin.bracket.square.css" } }, "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.entity.end.bracket.square.css" } }, "name": "meta.attribute-selector.css", "patterns": [ { "include": "#comment-block" }, { "include": "#string" }, { "captures": { "1": { "name": "storage.modifier.ignore-case.css" } }, "match": "(?<=[\"'\\s]|^|\\*/)\\s*([iI])\\s*(?=[\\s\\]]|/\\*|$)" }, { "captures": { "1": { "name": "string.unquoted.attribute-value.css", "patterns": [ { "include": "#escapes" } ] } }, "match": "(?x)(?<==)\\s*((?!/\\*)(?:[^\\\\\"'\\s\\]]|\\\\.)+)" }, { "include": "#escapes" }, { "match": "[~|^$*]?=", "name": "keyword.operator.pattern.css" }, { "match": "\\|", "name": "punctuation.separator.css" }, { "captures": { "1": { "name": "entity.other.namespace-prefix.css", "patterns": [ { "include": "#escapes" } ] } }, "match": "(?x)\n# Qualified namespace prefix\n( -?(?!\\d)(?:[\\w-]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+\n| \\*\n)\n# Lookahead to ensure there's a valid identifier ahead\n(?=\n \\| (?!\\s|=|$|\\])\n (?: -?(?!\\d)\n | [\\\\\\w-]\n | [^\\x00-\\x7F]\n )\n)" }, { "captures": { "1": { "name": "entity.other.attribute-name.css", "patterns": [ { "include": "#escapes" } ] } }, "match": "(?x)\n(-?(?!\\d)(?>[\\w-]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+)\n\\s*\n(?=[~|^\\]$*=]|/\\*)" } ] }, { "include": "#pseudo-classes" }, { "include": "#pseudo-elements" }, { "include": "#functional-pseudo-classes" }, { "match": "(?x) (?\\s,.\\#|){:\\[]|/\\*|$)", "name": "entity.name.tag.css" }, "unicode-range": { "captures": { "0": { "name": "constant.other.unicode-range.css" }, "1": { "name": "punctuation.separator.dash.unicode-range.css" } }, "match": "(?