Debian Codegraph @

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

raw
1 import { l as languages, r as rest } from "../../index-C1_GGQ8y.js";
2 import { e as extend, i as insertBefore } from "../../language-gdIi4UL0.js";
3 import { a as clikeComment, b as boolean } from "../../patterns-Cp3h1ylA.js";
4 import "./css.js";
5 var scss = languages.scss = extend("css", {
6 "comment": clikeComment(),
7 "atrule": {
8 pattern: /@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,
9 inside: {
10 "rule": /@[\w-]+/,
11 [rest]: "scss"
12 }
13 },
14 // url, compassified
15 "url": /(?:[-a-z]+-)?url(?=\()/i,
16 // CSS selector regex is not appropriate for Sass
17 // since there can be lot more things (var, @ directive, nesting..)
18 // a selector must start at the end of a property or after a brace (end of other rules or nesting)
19 // it can contain some characters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable
20 // the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var
21 // can "pass" as a selector- e.g: proper#{$erty})
22 // this one was hard to do, so please be careful if you edit this one :)
23 "selector": {
24 // Initial look-ahead is used to prevent matching of blank selectors
25 pattern: /(?!\s)[^@;(){}]?(?:[^@;(){}\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,
26 inside: {
27 "parent": {
28 pattern: /&/,
29 alias: "important"
30 },
31 "placeholder": /%[-\w]+/,
32 "variable": /\$[-\w]+|#\{\$[-\w]+\}/
33 }
34 },
35 "property": {
36 pattern: /(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,
37 inside: {
38 "variable": /\$[-\w]+|#\{\$[-\w]+\}/
39 }
40 }
41 });
42 insertBefore(scss, "atrule", {
43 "keyword": [
44 /@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,
45 {
46 pattern: /( )(?:from|through)(?= )/,
47 lookbehind: true
48 }
49 ]
50 });
51 insertBefore(scss, "important", {
52 // var and interpolated vars
53 "variable": /\$[-\w]+|#\{\$[-\w]+\}/
54 });
55 insertBefore(scss, "function", {
56 "module-modifier": {
57 pattern: /\b(?:as|hide|show|with)\b/i,
58 alias: "keyword"
59 },
60 "placeholder": {
61 pattern: /%[-\w]+/,
62 alias: "selector"
63 },
64 "statement": {
65 pattern: /\B!(?:default|optional)\b/i,
66 alias: "keyword"
67 },
68 "boolean": boolean,
69 "null": {
70 pattern: /\bnull\b/,
71 alias: "keyword"
72 },
73 "operator": {
74 pattern: /(\s)(?:[%/*+-]|[!=]=|[<>]=?|and|not|or)(?!\S)/,
75 lookbehind: true
76 }
77 });
78 //# sourceMappingURL=scss.js.map