Skip to content

Commit eef4248

Browse files
committed
SCSS: Highlight everything inside atrules
1 parent c19a238 commit eef4248

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

components/prism-scss.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ Prism.languages.scss = Prism.languages.extend('css', {
33
pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/,
44
lookbehind: true
55
},
6-
// aturle is just the @***, not the entire rule (to highlight var & stuffs)
7-
// + add ability to highlight number & unit for media queries
86
'atrule': {
97
pattern: /@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+(\{|;))/i,
108
inside: {
11-
'property': Prism.languages.css.property,
12-
'punctuation': /[():]/
9+
// See rest at the end of the file
1310
}
1411
},
1512
// url, compassified
@@ -40,3 +37,5 @@ Prism.languages.insertBefore('scss', 'function', {
4037
'null': /\b(null)\b/,
4138
'operator': /\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|%)\s+/
4239
});
40+
41+
Prism.languages.scss['atrule'].inside.rest = Prism.util.clone(Prism.languages.scss);

components/prism-scss.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)