PageSourceSearch

https://www.museum-newtonabbot.org.uk/js/CodeMirror-master/mode/css/css.js

js museum-newtonabbot.org.uk collected 2026-10-02 19:29:37 UTC 37,613 bytes, 830 lines download raw bytes

1// CodeMirror, copyright (c) by Marijn Haverbeke and others
2// Distributed under an MIT license: http://codemirror.net/LICENSE
3
4(function(mod) {
5  if (typeof exports == "object" && typeof module == "object") // CommonJS
6    mod(require("../../lib/codemirror"));
7  else if (typeof define == "function" && define.amd) // AMD
8    define(["../../lib/codemirror"], mod);
9  else // Plain browser env
10    mod(CodeMirror);
11})(function(CodeMirror) {
12"use strict";
13
14CodeMirror.defineMode("css", function(config, parserConfig) {
15  var inline = parserConfig.inline
16  if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
17
18  var indentUnit = config.indentUnit,
19      tokenHooks = parserConfig.tokenHooks,
20      documentTypes = parserConfig.documentTypes || {},
21      mediaTypes = parserConfig.mediaTypes || {},
22      mediaFeatures = parserConfig.mediaFeatures || {},
23      mediaValueKeywords = parserConfig.mediaValueKeywords || {},
24      propertyKeywords = parserConfig.propertyKeywords || {},
25      nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
26      fontProperties = parserConfig.fontProperties || {},
27      counterDescriptors = parserConfig.counterDescriptors || {},
28      colorKeywords = parserConfig.colorKeywords || {},
29      valueKeywords = parserConfig.valueKeywords || {},
30      allowNested = parserConfig.allowNested,
31      lineComment = parserConfig.lineComment,
vendor: 16,435 bytes, lines 32-477
32      supportsAtComponent = parserConfig.supportsAtComponent === true;
33
34  var type, override;
35  function ret(style, tp) { type = tp; return style; }
36
37  // Tokenizers
38
39  function tokenBase(stream, state) {
40    var ch = stream.next();
41    if (tokenHooks[ch]) {
42      var result = tokenHooks[ch](stream, state);
43      if (result !== false) return result;
44    }
45    if (ch == "@") {
46      stream.eatWhile(/[\w\\\-]/);
47      return ret("def", stream.current());
48    } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {
49      return ret(null, "compare");
50    } else if (ch == "\"" || ch == "'") {
51      state.tokenize = tokenString(ch);
52      return state.tokenize(stream, state);
53    } else if (ch == "#") {
54      stream.eatWhile(/[\w\\\-]/);
55      return ret("atom", "hash");
56    } else if (ch == "!") {
57      stream.match(/^\s*\w*/);
58      return ret("keyword", "important");
59    } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {
60      stream.eatWhile(/[\w.%]/);
61      return ret("number", "unit");
62    } else if (ch === "-") {
63      if (/[\d.]/.test(stream.peek())) {
64        stream.eatWhile(/[\w.%]/);
65        return ret("number", "unit");
66      } else if (stream.match(/^-[\w\\\-]+/)) {
67        stream.eatWhile(/[\w\\\-]/);
68        if (stream.match(/^\s*:/, false))
69          return ret("variable-2", "variable-definition");
70        return ret("variable-2", "variable");
71      } else if (stream.match(/^\w+-/)) {
72        return ret("meta", "meta");
73      }
74    } else if (/[,+>*\/]/.test(ch)) {
75      return ret(null, "select-op");
76    } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
77      return ret("qualifier", "qualifier");
78    } else if (/[:;{}\[\]\(\)]/.test(ch)) {
79      return ret(null, ch);
80    } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) ||
81               (ch == "d" && stream.match("omain(")) ||
82               (ch == "r" && stream.match("egexp("))) {
83      stream.backUp(1);
84      state.tokenize = tokenParenthesized;
85      return ret("property", "word");
86    } else if (/[\w\\\-]/.test(ch)) {
87      stream.eatWhile(/[\w\\\-]/);
88      return ret("property", "word");
89    } else {
90      return ret(null, null);
91    }
92  }
93
94  function tokenString(quote) {
95    return function(stream, state) {
96      var escaped = false, ch;
97      while ((ch = stream.next()) != null) {
98        if (ch == quote && !escaped) {
99          if (quote == ")") stream.backUp(1);
100          break;
101        }
102        escaped = !escaped && ch == "\\";
103      }
104      if (ch == quote || !escaped && quote != ")") state.tokenize = null;
105      return ret("string", "string");
106    };
107  }
108
109  function tokenParenthesized(stream, state) {
110    stream.next(); // Must be '('
111    if (!stream.match(/\s*[\"\')]/, false))
112      state.tokenize = tokenString(")");
113    else
114      state.tokenize = null;
115    return ret(null, "(");
116  }
117
118  // Context management
119
120  function Context(type, indent, prev) {
121    this.type = type;
122    this.indent = indent;
123    this.prev = prev;
124  }
125
126  function pushContext(state, stream, type, indent) {
127    state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);
128    return type;
129  }
130
131  function popContext(state) {
132    if (state.context.prev)
133      state.context = state.context.prev;
134    return state.context.type;
135  }
136
137  function pass(type, stream, state) {
138    return states[state.context.type](type, stream, state);
139  }
140  function popAndPass(type, stream, state, n) {
141    for (var i = n || 1; i > 0; i--)
142      state.context = state.context.prev;
143    return pass(type, stream, state);
144  }
145
146  // Parser
147
148  function wordAsValue(stream) {
149    var word = stream.current().toLowerCase();
150    if (valueKeywords.hasOwnProperty(word))
151      override = "atom";
152    else if (colorKeywords.hasOwnProperty(word))
153      override = "keyword";
154    else
155      override = "variable";
156  }
157
158  var states = {};
159
160  states.top = function(type, stream, state) {
161    if (type == "{") {
162      return pushContext(state, stream, "block");
163    } else if (type == "}" && state.context.prev) {
164      return popContext(state);
165    } else if (supportsAtComponent && /@component/.test(type)) {
166      return pushContext(state, stream, "atComponentBlock");
167    } else if (/^@(-moz-)?document$/.test(type)) {
168      return pushContext(state, stream, "documentTypes");
169    } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) {
170      return pushContext(state, stream, "atBlock");
171    } else if (/^@(font-face|counter-style)/.test(type)) {
172      state.stateArg = type;
173      return "restricted_atBlock_before";
174    } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
175      return "keyframes";
176    } else if (type && type.charAt(0) == "@") {
177      return pushContext(state, stream, "at");
178    } else if (type == "hash") {
179      override = "builtin";
180    } else if (type == "word") {
181      override = "tag";
182    } else if (type == "variable-definition") {
183      return "maybeprop";
184    } else if (type == "interpolation") {
185      return pushContext(state, stream, "interpolation");
186    } else if (type == ":") {
187      return "pseudo";
188    } else if (allowNested && type == "(") {
189      return pushContext(state, stream, "parens");
190    }
191    return state.context.type;
192  };
193
194  states.block = function(type, stream, state) {
195    if (type == "word") {
196      var word = stream.current().toLowerCase();
197      if (propertyKeywords.hasOwnProperty(word)) {
198        override = "property";
199        return "maybeprop";
200      } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
201        override = "string-2";
202        return "maybeprop";
203      } else if (allowNested) {
204        override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
205        return "block";
206      } else {
207        override += " error";
208        return "maybeprop";
209      }
210    } else if (type == "meta") {
211      return "block";
212    } else if (!allowNested && (type == "hash" || type == "qualifier")) {
213      override = "error";
214      return "block";
215    } else {
216      return states.top(type, stream, state);
217    }
218  };
219
220  states.maybeprop = function(type, stream, state) {
221    if (type == ":") return pushContext(state, stream, "prop");
222    return pass(type, stream, state);
223  };
224
225  states.prop = function(type, stream, state) {
226    if (type == ";") return popContext(state);
227    if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");
228    if (type == "}" || type == "{") return popAndPass(type, stream, state);
229    if (type == "(") return pushContext(state, stream, "parens");
230
231    if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
232      override += " error";
233    } else if (type == "word") {
234      wordAsValue(stream);
235    } else if (type == "interpolation") {
236      return pushContext(state, stream, "interpolation");
237    }
238    return "prop";
239  };
240
241  states.propBlock = function(type, _stream, state) {
242    if (type == "}") return popContext(state);
243    if (type == "word") { override = "property"; return "maybeprop"; }
244    return state.context.type;
245  };
246
247  states.parens = function(type, stream, state) {
248    if (type == "{" || type == "}") return popAndPass(type, stream, state);
249    if (type == ")") return popContext(state);
250    if (type == "(") return pushContext(state, stream, "parens");
251    if (type == "interpolation") return pushContext(state, stream, "interpolation");
252    if (type == "word") wordAsValue(stream);
253    return "parens";
254  };
255
256  states.pseudo = function(type, stream, state) {
257    if (type == "meta") return "pseudo";
258
259    if (type == "word") {
260      override = "variable-3";
261      return state.context.type;
262    }
263    return pass(type, stream, state);
264  };
265
266  states.documentTypes = function(type, stream, state) {
267    if (type == "word" && documentTypes.hasOwnProperty(stream.current())) {
268      override = "tag";
269      return state.context.type;
270    } else {
271      return states.atBlock(type, stream, state);
272    }
273  };
274
275  states.atBlock = function(type, stream, state) {
276    if (type == "(") return pushContext(state, stream, "atBlock_parens");
277    if (type == "}" || type == ";") return popAndPass(type, stream, state);
278    if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
279
280    if (type == "interpolation") return pushContext(state, stream, "interpolation");
281
282    if (type == "word") {
283      var word = stream.current().toLowerCase();
284      if (word == "only" || word == "not" || word == "and" || word == "or")
285        override = "keyword";
286      else if (mediaTypes.hasOwnProperty(word))
287        override = "attribute";
288      else if (mediaFeatures.hasOwnProperty(word))
289        override = "property";
290      else if (mediaValueKeywords.hasOwnProperty(word))
291        override = "keyword";
292      else if (propertyKeywords.hasOwnProperty(word))
293        override = "property";
294      else if (nonStandardPropertyKeywords.hasOwnProperty(word))
295        override = "string-2";
296      else if (valueKeywords.hasOwnProperty(word))
297        override = "atom";
298      else if (colorKeywords.hasOwnProperty(word))
299        override = "keyword";
300      else
301        override = "error";
302    }
303    return state.context.type;
304  };
305
306  states.atComponentBlock = function(type, stream, state) {
307    if (type == "}")
308      return popAndPass(type, stream, state);
309    if (type == "{")
310      return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false);
311    if (type == "word")
312      override = "error";
313    return state.context.type;
314  };
315
316  states.atBlock_parens = function(type, stream, state) {
317    if (type == ")") return popContext(state);
318    if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
319    return states.atBlock(type, stream, state);
320  };
321
322  states.restricted_atBlock_before = function(type, stream, state) {
323    if (type == "{")
324      return pushContext(state, stream, "restricted_atBlock");
325    if (type == "word" && state.stateArg == "@counter-style") {
326      override = "variable";
327      return "restricted_atBlock_before";
328    }
329    return pass(type, stream, state);
330  };
331
332  states.restricted_atBlock = function(type, stream, state) {
333    if (type == "}") {
334      state.stateArg = null;
335      return popContext(state);
336    }
337    if (type == "word") {
338      if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||
339          (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))
340        override = "error";
341      else
342        override = "property";
343      return "maybeprop";
344    }
345    return "restricted_atBlock";
346  };
347
348  states.keyframes = function(type, stream, state) {
349    if (type == "word") { override = "variable"; return "keyframes"; }
350    if (type == "{") return pushContext(state, stream, "top");
351    return pass(type, stream, state);
352  };
353
354  states.at = function(type, stream, state) {
355    if (type == ";") return popContext(state);
356    if (type == "{" || type == "}") return popAndPass(type, stream, state);
357    if (type == "word") override = "tag";
358    else if (type == "hash") override = "builtin";
359    return "at";
360  };
361
362  states.interpolation = function(type, stream, state) {
363    if (type == "}") return popContext(state);
364    if (type == "{" || type == ";") return popAndPass(type, stream, state);
365    if (type == "word") override = "variable";
366    else if (type != "variable" && type != "(" && type != ")") override = "error";
367    return "interpolation";
368  };
369
370  return {
371    startState: function(base) {
372      return {tokenize: null,
373              state: inline ? "block" : "top",
374              stateArg: null,
375              context: new Context(inline ? "block" : "top", base || 0, null)};
376    },
377
378    token: function(stream, state) {
379      if (!state.tokenize && stream.eatSpace()) return null;
380      var style = (state.tokenize || tokenBase)(stream, state);
381      if (style && typeof style == "object") {
382        type = style[1];
383        style = style[0];
384      }
385      override = style;
386      state.state = states[state.state](type, stream, state);
387      return override;
388    },
389
390    indent: function(state, textAfter) {
391      var cx = state.context, ch = textAfter && textAfter.charAt(0);
392      var indent = cx.indent;
393      if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
394      if (cx.prev) {
395        if (ch == "}" && (cx.type == "block" || cx.type == "top" ||
396                          cx.type == "interpolation" || cx.type == "restricted_atBlock")) {
397          // Resume indentation from parent context.
398          cx = cx.prev;
399          indent = cx.indent;
400        } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
401            ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
402          // Dedent relative to current context.
403          indent = Math.max(0, cx.indent - indentUnit);
404        }
405      }
406      return indent;
407    },
408
409    electricChars: "}",
410    blockCommentStart: "/*",
411    blockCommentEnd: "*/",
412    lineComment: lineComment,
413    fold: "brace"
414  };
415});
416
417  function keySet(array) {
418    var keys = {};
419    for (var i = 0; i < array.length; ++i) {
420      keys[array[i].toLowerCase()] = true;
421    }
422    return keys;
423  }
424
425  var documentTypes_ = [
426    "domain", "regexp", "url", "url-prefix"
427  ], documentTypes = keySet(documentTypes_);
428
429  var mediaTypes_ = [
430    "all", "aural", "braille", "handheld", "print", "projection", "screen",
431    "tty", "tv", "embossed"
432  ], mediaTypes = keySet(mediaTypes_);
433
434  var mediaFeatures_ = [
435    "width", "min-width", "max-width", "height", "min-height", "max-height",
436    "device-width", "min-device-width", "max-device-width", "device-height",
437    "min-device-height", "max-device-height", "aspect-ratio",
438    "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
439    "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
440    "max-color", "color-index", "min-color-index", "max-color-index",
441    "monochrome", "min-monochrome", "max-monochrome", "resolution",
442    "min-resolution", "max-resolution", "scan", "grid", "orientation",
443    "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
444    "pointer", "any-pointer", "hover", "any-hover"
445  ], mediaFeatures = keySet(mediaFeatures_);
446
447  var mediaValueKeywords_ = [
448    "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
449    "interlace", "progressive"
450  ], mediaValueKeywords = keySet(mediaValueKeywords_);
451
452  var propertyKeywords_ = [
453    "align-content", "align-items", "align-self", "alignment-adjust",
454    "alignment-baseline", "anchor-point", "animation", "animation-delay",
455    "animation-direction", "animation-duration", "animation-fill-mode",
456    "animation-iteration-count", "animation-name", "animation-play-state",
457    "animation-timing-function", "appearance", "azimuth", "backface-visibility",
458    "background", "background-attachment", "background-blend-mode", "background-clip",
459    "background-color", "background-image", "background-origin", "background-position",
460    "background-repeat", "background-size", "baseline-shift", "binding",
461    "bleed", "bookmark-label", "bookmark-level", "bookmark-state",
462    "bookmark-target", "border", "border-bottom", "border-bottom-color",
463    "border-bottom-left-radius", "border-bottom-right-radius",
464    "border-bottom-style", "border-bottom-width", "border-collapse",
465    "border-color", "border-image", "border-image-outset",
466    "border-image-repeat", "border-image-slice", "border-image-source",
467    "border-image-width", "border-left", "border-left-color",
468    "border-left-style", "border-left-width", "border-radius", "border-right",
469    "border-right-color", "border-right-style", "border-right-width",
470    "border-spacing", "border-style", "border-top", "border-top-color",
471    "border-top-left-radius", "border-top-right-radius", "border-top-style",
472    "border-top-width", "border-width", "bottom", "box-decoration-break",
473    "box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
474    "caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
475    "column-fill", "column-gap", "column-rule", "column-rule-color",
476    "column-rule-style", "column-rule-width", "column-span", "column-width",
477    "columns", "content", "counter-increment", "counter-reset", "crop", "cue",
478    "cue-after", "cue-before", "cursor", "direction", "display",
479    "dominant-baseline", "drop-initial-after-adjust",
480    "drop-initial-after-align", "drop-initial-before-adjust",
481    "drop-initial-before-align", "drop-initial-size", "drop-initial-value",
482    "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
483    "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
484    "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",
485    "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust",
486    "font-stretch", "font-style", "font-synthesis", "font-variant",
487    "font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
488    "font-variant-ligatures", "font-variant-numeric", "font-variant-position",
489    "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
490    "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap",
491    "grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap",
492    "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
493    "grid-template-rows", "hanging-punctuation", "height", "hyphens",
494    "icon", "image-orientation", "image-rendering", "image-resolution",
495    "inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
496    "line-break", "line-height", "line-stacking", "line-stacking-ruby",
497    "line-stacking-shift", "line-stacking-strategy", "list-style",
498    "list-style-image", "list-style-position", "list-style-type", "margin",
499    "margin-bottom", "margin-left", "margin-right", "margin-top",
500    "marks", "marquee-direction", "marquee-loop",
501    "marquee-play-count", "marquee-speed", "marquee-style", "max-height",
502    "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
503    "nav-left", "nav-right", "nav-up", "object-fit", "object-position",
504    "opacity", "order", "orphans", "outline",
505    "outline-color", "outline-offset", "outline-style", "outline-width",
506    "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
507    "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
508    "page", "page-break-after", "page-break-before", "page-break-inside",
509    "page-policy", "pause", "pause-after", "pause-before", "perspective",
510    "perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
511    "presentation-level", "punctuation-trim", "quotes", "region-break-after",
512    "region-break-before", "region-break-inside", "region-fragment",
513    "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
514    "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",
515    "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin",
516    "shape-outside", "size", "speak", "speak-as", "speak-header",
517    "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
518    "tab-size", "table-layout", "target", "target-name", "target-new",
519    "target-position", "text-align", "text-align-last", "text-decoration",
520    "text-decoration-color", "text-decoration-line", "text-decoration-skip",
521    "text-decoration-style", "text-emphasis", "text-emphasis-color",
522    "text-emphasis-position", "text-emphasis-style", "text-height",
523    "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",
524    "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position",
525    "text-wrap", "top", "transform", "transform-origin", "transform-style",
526    "transition", "transition-delay", "transition-duration",
527    "transition-property", "transition-timing-function", "unicode-bidi",
528    "user-select", "vertical-align", "visibility", "voice-balance", "voice-duration",
529    "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
530    "voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break",
531    "word-spacing", "word-wrap", "z-index",
532    // SVG-specific
533    "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
534    "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
535    "color-interpolation", "color-interpolation-filters",
536    "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",
537    "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke",
538    "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",
539    "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",
540    "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",
541    "glyph-orientation-vertical", "text-anchor", "writing-mode"
542  ], propertyKeywords = keySet(propertyKeywords_);
543
544  var nonStandardPropertyKeywords_ = [
545    "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
546    "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
547    "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside",
548    "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
549    "searchfield-results-decoration", "zoom"
550  ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
551
552  var fontProperties_ = [
553    "font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
554    "font-stretch", "font-weight", "font-style"
555  ], fontProperties = keySet(fontProperties_);
556
557  var counterDescriptors_ = [
558    "additive-symbols", "fallback", "negative", "pad", "prefix", "range",
559    "speak-as", "suffix", "symbols", "system"
560  ], counterDescriptors = keySet(counterDescriptors_);
561
562  var colorKeywords_ = [
563    "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
564    "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
565    "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
566    "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
567    "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
568    "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
569    "darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
570    "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
571    "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
572    "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
573    "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
574    "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
575    "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
576    "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
577    "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
578    "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
579    "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
580    "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",
581    "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered",
582    "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",
583    "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
584    "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
585    "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
586    "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
587    "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
588    "whitesmoke", "yellow", "yellowgreen"
589  ], colorKeywords = keySet(colorKeywords_);
590
591  var valueKeywords_ = [
592    "above", "absolute", "activeborder", "additive", "activecaption", "afar",
593    "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate",
594    "always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
595    "arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
596    "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",
597    "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
598    "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
599    "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
600    "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
601    "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
602    "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
603    "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
604    "compact", "condensed", "contain", "content", "contents",
605    "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
606    "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
607    "decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
608    "destination-in", "destination-out", "destination-over", "devanagari", "difference",
609    "disc", "discard", "disclosure-closed", "disclosure-open", "document",
610    "dot-dash", "dot-dot-dash",
611    "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
612    "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
613    "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
614    "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
615    "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
616    "ethiopic-halehame-gez", "ethiopic-halehame-om-et",
617    "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
618    "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
619    "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
620    "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
621    "forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
622    "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
623    "help", "hidden", "hide", "higher", "highlight", "highlighttext",
624    "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
625    "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
626    "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
627    "inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
628    "italic", "japanese-formal", "japanese-informal", "justify", "kannada",
629    "katakana", "katakana-iroha", "keep-all", "khmer",
630    "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
631    "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten",
632    "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
633    "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
634    "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
635    "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d",
636    "media-controls-background", "media-current-time-display",
637    "media-fullscreen-button", "media-mute-button", "media-play-button",
638    "media-return-to-realtime-button", "media-rewind-button",
639    "media-seek-back-button", "media-seek-forward-button", "media-slider",
640    "media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
641    "media-volume-slider-container", "media-volume-sliderthumb", "medium",
642    "menu", "menulist", "menulist-button", "menulist-text",
643    "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
644    "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
645    "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
646    "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
647    "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote",
648    "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
649    "outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
650    "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter",
651    "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
652    "progress", "push-button", "radial-gradient", "radio", "read-only",
653    "read-write", "read-write-plaintext-only", "rectangle", "region",
654    "relative", "repeat", "repeating-linear-gradient",
655    "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
656    "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
657    "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
658    "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
659    "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
660    "searchfield-cancel-button", "searchfield-decoration",
661    "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
662    "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
663    "simp-chinese-formal", "simp-chinese-informal", "single",
664    "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
vendor: 6,144 bytes, lines 665-830
665    "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
666    "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
667    "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
668    "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
669    "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
670    "table-caption", "table-cell", "table-column", "table-column-group",
671    "table-footer-group", "table-header-group", "table-row", "table-row-group",
672    "tamil",
673    "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
674    "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
675    "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
676    "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
677    "trad-chinese-formal", "trad-chinese-informal", "transform",
678    "translate", "translate3d", "translateX", "translateY", "translateZ",
679    "transparent", "ultra-condensed", "ultra-expanded", "underline", "unset", "up",
680    "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
681    "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
682    "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
683    "visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
684    "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor",
685    "xx-large", "xx-small"
686  ], valueKeywords = keySet(valueKeywords_);
687
688  var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)
689    .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)
690    .concat(valueKeywords_);
691  CodeMirror.registerHelper("hintWords", "css", allWords);
692
693  function tokenCComment(stream, state) {
694    var maybeEnd = false, ch;
695    while ((ch = stream.next()) != null) {
696      if (maybeEnd && ch == "/") {
697        state.tokenize = null;
698        break;
699      }
700      maybeEnd = (ch == "*");
701    }
702    return ["comment", "comment"];
703  }
704
705  CodeMirror.defineMIME("text/css", {
706    documentTypes: documentTypes,
707    mediaTypes: mediaTypes,
708    mediaFeatures: mediaFeatures,
709    mediaValueKeywords: mediaValueKeywords,
710    propertyKeywords: propertyKeywords,
711    nonStandardPropertyKeywords: nonStandardPropertyKeywords,
712    fontProperties: fontProperties,
713    counterDescriptors: counterDescriptors,
714    colorKeywords: colorKeywords,
715    valueKeywords: valueKeywords,
716    tokenHooks: {
717      "/": function(stream, state) {
718        if (!stream.eat("*")) return false;
719        state.tokenize = tokenCComment;
720        return tokenCComment(stream, state);
721      }
722    },
723    name: "css"
724  });
725
726  CodeMirror.defineMIME("text/x-scss", {
727    mediaTypes: mediaTypes,
728    mediaFeatures: mediaFeatures,
729    mediaValueKeywords: mediaValueKeywords,
730    propertyKeywords: propertyKeywords,
731    nonStandardPropertyKeywords: nonStandardPropertyKeywords,
732    colorKeywords: colorKeywords,
733    valueKeywords: valueKeywords,
734    fontProperties: fontProperties,
735    allowNested: true,
736    lineComment: "//",
737    tokenHooks: {
738      "/": function(stream, state) {
739        if (stream.eat("/")) {
740          stream.skipToEnd();
741          return ["comment", "comment"];
742        } else if (stream.eat("*")) {
743          state.tokenize = tokenCComment;
744          return tokenCComment(stream, state);
745        } else {
746          return ["operator", "operator"];
747        }
748      },
749      ":": function(stream) {
750        if (stream.match(/\s*\{/, false))
751          return [null, null]
752        return false;
753      },
754      "$": function(stream) {
755        stream.match(/^[\w-]+/);
756        if (stream.match(/^\s*:/, false))
757          return ["variable-2", "variable-definition"];
758        return ["variable-2", "variable"];
759      },
760      "#": function(stream) {
761        if (!stream.eat("{")) return false;
762        return [null, "interpolation"];
763      }
764    },
765    name: "css",
766    helperType: "scss"
767  });
768
769  CodeMirror.defineMIME("text/x-less", {
770    mediaTypes: mediaTypes,
771    mediaFeatures: mediaFeatures,
772    mediaValueKeywords: mediaValueKeywords,
773    propertyKeywords: propertyKeywords,
774    nonStandardPropertyKeywords: nonStandardPropertyKeywords,
775    colorKeywords: colorKeywords,
776    valueKeywords: valueKeywords,
777    fontProperties: fontProperties,
778    allowNested: true,
779    lineComment: "//",
780    tokenHooks: {
781      "/": function(stream, state) {
782        if (stream.eat("/")) {
783          stream.skipToEnd();
784          return ["comment", "comment"];
785        } else if (stream.eat("*")) {
786          state.tokenize = tokenCComment;
787          return tokenCComment(stream, state);
788        } else {
789          return ["operator", "operator"];
790        }
791      },
792      "@": function(stream) {
793        if (stream.eat("{")) return [null, "interpolation"];
794        if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false;
795        stream.eatWhile(/[\w\\\-]/);
796        if (stream.match(/^\s*:/, false))
797          return ["variable-2", "variable-definition"];
798        return ["variable-2", "variable"];
799      },
800      "&": function() {
801        return ["atom", "atom"];
802      }
803    },
804    name: "css",
805    helperType: "less"
806  });
807
808  CodeMirror.defineMIME("text/x-gss", {
809    documentTypes: documentTypes,
810    mediaTypes: mediaTypes,
811    mediaFeatures: mediaFeatures,
812    propertyKeywords: propertyKeywords,
813    nonStandardPropertyKeywords: nonStandardPropertyKeywords,
814    fontProperties: fontProperties,
815    counterDescriptors: counterDescriptors,
816    colorKeywords: colorKeywords,
817    valueKeywords: valueKeywords,
818    supportsAtComponent: true,
819    tokenHooks: {
820      "/": function(stream, state) {
821        if (!stream.eat("*")) return false;
822        state.tokenize = tokenCComment;
823        return tokenCComment(stream, state);
824      }
825    },
826    name: "css",
827    helperType: "gss"
828  });
829
830});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.