Debian Codegraph @

inst/lib/prism-code-editor/prism/languages/sass.js

raw
1 import { l as languages } from "../../index-C1_GGQ8y.js";
2 import { e as extend, i as insertBefore } from "../../language-gdIi4UL0.js";
3 import "./css.js";
4 var variable = /\$[-\w]+|#\{\$[-\w]+\}/;
5 var operator = {
6 pattern: /[%/*+]|[!=]=|<=?|>=?|\b(?:and|not|or)\b|(\s)-(?!\S)/,
7 lookbehind: true
8 };
9 var sass = languages.sass = extend("css", {
10 // Sass comments don't need to be closed, only indented
11 "comment": {
12 pattern: /^([ ]*)\/[/*].*(?:$\s*?\n\1[ ]+\S.*)*/mg,
13 lookbehind: true,
14 greedy: true
15 }
16 });
17 insertBefore(sass, "atrule", {
18 // We want to consume the whole line
19 "atrule-line": {
20 // Includes support for = and + shortcuts
21 pattern: /^(?:[ ]*)[@+=].+/mg,
22 greedy: true,
23 inside: {
24 "atrule": /(?:@[\w-]+|[+=])/
25 }
26 }
27 });
28 delete sass.atrule;
29 insertBefore(sass, "property", {
30 // We want to consume the whole line
31 "variable-line": {
32 pattern: /^[ ]*\$.+/mg,
33 greedy: true,
34 inside: {
35 "punctuation": /:/,
36 "variable": variable,
37 "operator": operator
38 }
39 },
40 // We want to consume the whole line
41 "property-line": {
42 pattern: /^[ ]*(?:[^:\s]+ *:.*|:[^:\s].*)/mg,
43 greedy: true,
44 inside: {
45 "property": [
46 /[^:\s]+(?=\s*:)/,
47 {
48 pattern: /(:)[^:\s]+/,
49 lookbehind: true
50 }
51 ],
52 "punctuation": /:/,
53 "variable": variable,
54 "operator": operator,
55 "important": sass.important
56 }
57 }
58 });
59 delete sass.property;
60 delete sass.important;
61 insertBefore(sass, "punctuation", {
62 "selector": {
63 pattern: /^([ ]*)\S(?:,[^\n,]+|[^\n,]*)(?:,[^\n,]+)*(?:,\n\1[ ]+\S(?:,[^\n,]+|[^\n,]*)(?:,[^\n,]+)*)*/mg,
64 lookbehind: true,
65 greedy: true
66 }
67 });
68 //# sourceMappingURL=sass.js.map