Skip to content

Commit

Permalink
SCSS: Highlight everything inside atrules
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Jul 8, 2015
1 parent c19a238 commit eef4248
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions components/prism-scss.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ Prism.languages.scss = Prism.languages.extend('css', {
pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/,
lookbehind: true
},
// aturle is just the @***, not the entire rule (to highlight var & stuffs)
// + add ability to highlight number & unit for media queries
'atrule': {
pattern: /@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+(\{|;))/i,
inside: {
'property': Prism.languages.css.property,
'punctuation': /[():]/
// See rest at the end of the file
}
},
// url, compassified
Expand Down Expand Up @@ -40,3 +37,5 @@ Prism.languages.insertBefore('scss', 'function', {
'null': /\b(null)\b/,
'operator': /\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|%)\s+/
});

Prism.languages.scss['atrule'].inside.rest = Prism.util.clone(Prism.languages.scss);
2 changes: 1 addition & 1 deletion components/prism-scss.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eef4248

Please sign in to comment.