%YAML 1.2 --- # http://www.sublimetext.com/docs/3/syntax.html name: LESS comment: LESS file_extensions: - less scope: source.less contexts: main: - include: comment-block - include: comment-line - include: less-at-rules - include: less-declarations - include: less-variables - include: less-functions - include: string-double - include: string-single - include: selector - include: rule-list - include: less-operators - include: less-parameters - include: numeric-values color-values: - match: \b(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)\b comment: http://www.w3.org/TR/CSS21/syndata.html#value-def-color scope: support.constant.color.w3c-standard-color-name.css - match: \b(aliceblue|antiquewhite|aquamarine|azure|beige|bisque|blanchedalmond|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|gainsboro|ghostwhite|gold|goldenrod|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|limegreen|linen|magenta|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|oldlace|olivedrab|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|thistle|tomato|turquoise|violet|wheat|whitesmoke|yellowgreen)\b comment: "These colours are mostly recognised but will not validate. ref: http://www.w3schools.com/css/css_colornames.asp" scope: support.constant.color.non-standard - match: (hsla?|rgba?)\s*(\() captures: 1: support.function.misc.css 2: punctuation.section.function.css push: - match: (\)) captures: 1: punctuation.section.function.css pop: true - match: '(?x)\b(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\s*,\s*){2}(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\b)(\s*,\s*((0?\.[0-9]+)|[0-1]))?' scope: constant.other.color.rgb-value.css - match: '\b([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%' scope: constant.other.color.rgb-percentage.css - include: numeric-values comment-block: - match: /\* captures: 0: punctuation.definition.comment.css push: - meta_scope: comment.block.css - match: \*/ captures: 0: punctuation.definition.comment.css pop: true comment-line: - match: // captures: 0: punctuation.definition.comment.css push: - meta_scope: comment.line.double-slash.less - match: $\n? captures: 0: punctuation.definition.comment.css pop: true less-at-rules: - match: ^\s*((@)(?:-(?:webkit|moz|o)-)?(charset|import|namespace|media|page|font-face|keyframes|supports|document)\b) scope: meta.at-rule.css captures: 1: keyword.control.at-rule.css 2: punctuation.definition.keyword.css less-data-uri: - match: (url)(\()(data:) captures: 1: support.function.misc.css 2: punctuation.section.function.css 3: parameter.less.data-uri comment markup.raw push: - meta_content_scope: parameter.less.data-uri comment markup.raw - match: (\)) captures: 1: punctuation.section.function.css pop: true - match: (url)(\()("data:) captures: 1: support.function.misc.css 2: punctuation.section.function.css 3: parameter.less.data-uri comment markup.raw push: - meta_content_scope: parameter.less.data-uri comment markup.raw - match: (?<=")(\)) captures: 1: punctuation.section.function.css pop: true - match: (url)(\()('data:) captures: 1: support.function.misc.css 2: punctuation.section.function.css 3: parameter.less.data-uri comment markup.raw push: - meta_content_scope: parameter.less.data-uri comment markup.raw - match: (?<=\')(\)) captures: 1: punctuation.section.function.css pop: true less-declarations: - match: '(?>@[a-zA-Z0-9_-][\w-]*+)(?!:)' scope: variable.other.less - match: '@[a-zA-Z0-9_-][\w-]*' scope: variable.declaration.less less-functions: - match: '([%a-zA-Z\-\_\d]*)(?=\()' scope: support.function.less - match: '([\.#](?![0-9])[a-zA-Z0-9_-]+(?=\())' captures: 1: entity.other.attribute-name.class.css entity.other.less.mixin less-operators: - match: /|!important|$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|(?([''"])(?:[^\\]|\\.)*?(\6)))))?\s*(\])' scope: meta.attribute-selector.css captures: 1: punctuation.definition.entity.css 2: entity.other.attribute-name.attribute.css 3: punctuation.separator.operator.css 4: string.unquoted.attribute-value.css 5: string.quoted.double.attribute-value.css 6: punctuation.definition.string.begin.css 7: punctuation.definition.string.end.css string-double: - match: '"' captures: 0: punctuation.definition.string.begin.css push: - meta_scope: string.quoted.double.css - match: '"' captures: 0: punctuation.definition.string.end.css pop: true - match: \\. scope: constant.character.escape.css string-single: - match: "'" captures: 0: punctuation.definition.string.begin.css push: - meta_scope: string.quoted.single.css - match: "'" captures: 0: punctuation.definition.string.end.css pop: true - match: \\. scope: constant.character.escape.css