{ "name": "Stylus", "scopeName": "source.stylus", "fileTypes": [ "styl", "stylus" ], "foldingStartMarker": "\\{\\s*$", "foldingStopMarker": "^\\s*\\}", "uuid": "5739E0FB-A2C0-4CB4-AB89-AFFFFD1F3FA1", "repository": { "string-quoted": { "patterns": [ { "match": "'[^']*'", "name": "string.quoted.single.stylus" }, { "match": "\"[^\"]*\"", "name": "string.quoted.double.stylus" } ] }, "variable": { "match": "([\\w$-]+\\b)", "name": "variable.other.stylus" }, "hash-definition": { "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.section.embedded.start.stylus" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.embedded.end.stylus" } }, "patterns": [ { "include": "#single-line-comment" }, { "begin": "(?x)\n(?:\n ([\\w$-]+)\n |\n ('[^']*')\n |\n (\"[^\"]*\")\n)\n\\s*\n(:)\n\\s*\n", "beginCaptures": { "1": { "name": "support.type.property-name.stylus" }, "2": { "name": "string.quoted.single.stylus" }, "3": { "name": "string.quoted.double.stylus" }, "4": { "name": "punctuation.separator.key-value.stylus" } }, "patterns": [ { "include": "#expression" } ], "end": "(;)|(?=\\}|$)", "endCaptures": { "1": { "name": "punctuation.terminator.statement.stylus" } } } ], "name": "meta.hash.stylus" }, "hash-access": { "begin": "(?=[\\w$-]+(?:\\.|\\[[^\\]=]*\\]))", "end": "(?=[^''\"\"\\[\\]\\w.$-]|\\s|$)", "patterns": [ { "match": "\\.", "name": "punctuation.delimiter.hash.stylus" }, { "match": "\\[", "name": "punctuation.definition.entity.start.stylus" }, { "match": "\\]", "name": "punctuation.definition.entity.end.stylus" }, { "include": "#string-quoted" }, { "include": "#variable" } ], "name": "meta.hash-access.stylus" }, "escape": { "match": "\\\\.", "name": "constant.character.escape.stylus" }, "interpolation": { "begin": "\\{", "end": "\\}", "beginCaptures": { "0": { "name": "punctuation.section.embedded.start.stylus" } }, "endCaptures": { "0": { "name": "punctuation.section.embedded.end.stylus" } }, "patterns": [ { "include": "#expression" } ], "name": "stylus.embedded.source" }, "language-constants": { "match": "\\b(true|false|null)\\b", "name": "constant.language.stylus" }, "language-operators": { "match": "((?:\\?|:|!|~|\\+|-|(?:\\*)?\\*|\\/|%|(\\.)?\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!=)|\\b(?:in|is(?:nt)?|(?]", "name": "keyword.operator.selector.stylus" }, { "match": "(?x) # multi-line regex definition mode\n\\b(\n altGlyph|altGlyphDef|altGlyphItem|animate|animateColor|\n animateMotion|animateTransform|circle|clipPath|color-profile|\n defs|desc|ellipse|feBlend|feColorMatrix|\n feComponentTransfer|feComposite|feConvolveMatrix|\n feDiffuseLighting|feDisplacementMap|feDistantLight|feFlood|\n feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feImage|feMerge|\n feMergeNode|feMorphology|feOffset|fePointLight|\n feSpecularLighting|feSpotLight|feTile|feTurbulence|filter|\n font-face|font-face-format|font-face-name|font-face-src|\n font-face-uri|foreignObject|g|glyph|glyphRef|hkern|image|line|\n linearGradient|marker|mask|metadata|missing-glyph|mpath|path|\n pattern|polygon|polyline|radialGradient|rect|set|stop|svg|\n switch|symbol|text|textPath|tref|tspan|use|view|vkern|\n a|abbr|acronym|address|applet|area|article|aside|audio|b|base|\n basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|\n canvas|caption|center|cite|code|col|colgroup|content|data|\n datalist|dd|decorator|del|details|dfn|dir|div|dl|dt|element|\n em|embed|fieldset|figcaption|figure|font|footer|form|frame|\n frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|\n img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|\n main|map|mark|marquee|menu|menuitem|meta|meter|nav|nobr|\n noframes|noscript|object|ol|optgroup|option|output|p|param|\n plaintext|pre|progress|q|rp|rt|ruby|s|samp|script|section|\n select|shadow|small|source|spacer|span|strike|strong|style|\n sub|summary|sup|table|tbody|td|template|textarea|tfoot|th|\n thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp\n)\\b\n", "name": "entity.name.tag.stylus" }, { "match": "\\.[a-zA-Z0-9_-]+", "name": "entity.other.attribute-name.class.stylus" }, { "match": "\\.[a-zA-Z0-9_-]+", "name": "entity.other.attribute-name.class.stylus" }, { "match": "#[a-zA-Z0-9_-]+", "name": "entity.other.attribute-name.class.stylus" }, { "match": "(?x) # multi-line regex definition mode\n([\\w\\d_-]+)? # matching any word right before &\n(&) # & itself, escaped because of plist\n([\\w\\d_-]+)? # matching any word right after &\n", "captures": { "1": { "name": "entity.other.attribute-name.stylus" }, "2": { "name": "variable.language.stylus" }, "3": { "name": "entity.other.attribute-name.stylus" } } } ] }, "single-line-comment": { "patterns": [ { "captures": { "1": { "name": "punctuation.definition.comment.stylus" } }, "match": "(\\/\\/).*$", "name": "comment.line.stylus" } ] }, "comments": { "patterns": [ { "include": "#single-line-comment" }, { "begin": "\\/\\*", "captures": { "0": { "name": "punctuation.definition.comment.stylus" } }, "end": "\\*\\/", "name": "comment.block.stylus" } ] } }, "patterns": [ { "include": "#comments" }, { "begin": "^\\s*(@(?:import|charset|css|font-face|(?:-webkit-)?keyframes)(?:\\s+([\\w-]+))?)\\b", "beginCaptures": { "1": { "name": "keyword.control.at-rule.other.stylus" }, "2": { "name": "variable.other.animation-name.stylus" } }, "patterns": [ { "include": "#string-quoted" } ], "end": "$|;|(?=\\{)" }, { "begin": "^\\s*(@media)\\s*", "beginCaptures": { "1": { "name": "keyword.control.at-rule.media.stylus" } }, "patterns": [ { "include": "#media-query" } ], "end": "$|(?=\\{)" }, { "begin": "(?x)\n(?<=^|;|})\n\\s*\n(?=\n [\\[\\]'\".\\w$-]+\n \\s*\n ([?:]?=)\n (?![^\\[]*\\])\n)\n", "patterns": [ { "include": "#expression" } ], "end": "$|;" }, { "include": "#iteration" }, { "include": "#conditionals" }, { "include": "#return" }, { "begin": "(?x) # multi-line regex definition mode\n\n^(\\s*) # starts at the beginning of line\n([\\w$-]+) # identifier (name)\n(\\() # start of argument list\n(?=\n .*?\n \\)\\s*\\{ # we see a curly brace afterwards\n) # which means this is a function definition\n", "beginCaptures": { "2": { "name": "entity.name.function.stylus" }, "3": { "name": "punctuation.definition.parameters.start.stylus" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.stylus" } }, "patterns": [ { "include": "#expression" } ], "name": "meta.function-call.stylus" }, { "begin": "(?x) # multi-line regex definition mode\n(\n\n (^|;) # starts at the beginning of line or at a ;\n \\s*\n (\\+?\\s* # for block mixins\n [\\w$-]+) # identifier (name)\n (\\() # start of argument list\n (?=\n .*?\n \\)\\s*;?\\s* # if there are only spaces and semicolons\n $|; # then this a \n )\n)\n", "beginCaptures": { "3": { "name": "entity.other.attribute-name.mixin.stylus" }, "4": { "name": "punctuation.definition.parameters.start.stylus" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.stylus" } }, "patterns": [ { "include": "#expression" } ], "name": "meta.function-call.stylus" }, { "begin": "(?x) # multi-line regex definition mode\n(^|(?<=\\*/|\\}))\\s*\n(?=\n font(?!\n \\s*:\\s\n |\n -\n |\n .*?\n (?:\n \\/|normal|bold|light(er?)|serif|sans|monospace|\n \\b\\d+(?:\\b|px|r?em|%)|\n ['\"][^\\]]*$\n )\n ) | # we need to distinguish between tag and property `cursor`\n cursor(?!\n \\s*[:;]\\s\n |\n -\n |\n .*?\n (?:\n (?:url\\s*\\()|\n (?:-moz-|-webkit-|-ms-)?\n (?:auto|default|none|context-menu|help|pointer|progress|\n wait|cell|crosshair|text|vertical-text|alias|copy|\n move|no-drop|not-allowed|e-resize|n-resize|ne-resize|\n nw-resize|s-resize|se-resize|sw-resize|w-resize|\n ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|\n row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing\n normal|bold|light(er?)|serif|sans|monospace)\n )\n ) | (\n (\n altGlyph|altGlyphDef|altGlyphItem|animate|animateColor|\n animateMotion|animateTransform|circle|clipPath|color-profile|\n defs|desc|ellipse|feBlend|feColorMatrix|\n feComponentTransfer|feComposite|feConvolveMatrix|\n feDiffuseLighting|feDisplacementMap|feDistantLight|feFlood|\n feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feImage|feMerge|\n feMergeNode|feMorphology|feOffset|fePointLight|\n feSpecularLighting|feSpotLight|feTile|feTurbulence|filter|\n font-face|font-face-format|font-face-name|font-face-src|\n font-face-uri|foreignObject|g|glyph|glyphRef|hkern|image|line|\n linearGradient|marker|mask|metadata|missing-glyph|mpath|path|\n pattern|polygon|polyline|radialGradient|rect|set|stop|svg|\n switch|symbol|text|textPath|tref|tspan|use|view|vkern|\n a|abbr|acronym|address|applet|area|article|aside|audio|b|base|\n basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|\n canvas|caption|center|cite|code|col|colgroup|data|\n datalist|dd|decorator|del|details|dfn|dir|div|dl|dt|element|\n em|embed|fieldset|figcaption|figure|footer|form|frame|\n frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|\n img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|\n main|map|mark|marquee|menu|menuitem|meta|meter|nav|nobr|\n noframes|noscript|object|ol|optgroup|option|output|p|param|\n plaintext|pre|progress|q|rp|rt|ruby|s|samp|script|section|\n select|shadow|small|source|spacer|span|strike|strong|style|\n sub|summary|sup|table|tbody|td|template|textarea|tfoot|th|\n thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp)\n\n \\s*([\\s,.#\\[]|:[^\\s]|(?=\\{|$))\n\n ) | (\n [:~>\\[*\\/] # symbols but they are valid for selector\n\n ) | (\n\n \\+\\s*[\\w$-]+\\b\\s* # are an identifier starting with $\n (?!\\() # and they can't have anything besides\n\n ) | ( # for animtions\n\n \\d+(\\.\\d+)?%|(from|to)\\b\n\n ) | ( # Placeholder selectors\n\n \\$[\\w$-]+\\b\\s* # are an identifier starting with $\n (?=$|\\{) # and they can't have anything besides\n\n ) | ( # CSS class\n\n \\.[a-zA-Z0-9_-]+\n\n ) | ( # CSS id\n\n \\#[a-zA-Z0-9_-]+\n\n ) | ( # Reference to parent\n\n ([\\w\\d_-]+)? # matching any word right before &\n (&) # & itself, escaped because of plist\n ([\\w\\d_-]+)? # matching any word right after &\n )\n)\n", "patterns": [ { "include": "#comma" }, { "match": "\\d+(\\.\\d+)?%|from|to", "name": "entity.other.animation-keyframe.stylus" }, { "include": "#selector-components" }, { "match": ".", "name": "entity.other.attribute-name.stylus" } ], "end": "\n|$|(?=\\{\\s*\\}.*$)|(?=\\{.*?[:;])|(?=\\{)(?!.+\\}.*$)", "name": "meta.selector.stylus" }, { "begin": "(?x) # multi-line regex definition mode\n(?<=^|;|{)\\s* # starts after begining of line, '{' or ';''\n(?= # lookahead for\n (\n [a-zA-Z0-9_-] # then a letter\n | # or\n (\\{(.*?)\\}) # interpolation\n | # or\n (/\\*.*?\\*/) # comment\n )+\n\n \\s*[:\\s]\\s* # value is separted by colon or space\n\n (?!(\\s*\\{)) # if there are only spaces afterwards\n\n (?!\n [^}]*? # checking for an unclosed curly braces on this\n \\{ # line because if one exists it means that\n [^}]* # this is a selector and not a property\n ($|\\})\n )\n)\n", "end": "(?=\\}|;)|(?