Skip to content

Commit 45d9274

Browse files
authored
Add color rule for JavaScript and JSX syntax (#235)
* Add color rule for JavaScript and JSX syntax This adds support for colors embedded in strings in the JavaScript and JSX syntaxes. This greatly helps when developing UI using CSS-in-JS systems such as [Stitches](https://stitches.dev) or [Styled Components](https://styled-components.com). Solves #87. * Remove dangling commas
1 parent b71692e commit 45d9274

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

color_helper.sublime-settings

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,18 @@
338338
"meta.tag.any.html meta.attribute-with-value.style.html"
339339
]
340340
},
341+
{
342+
"name": "JavaScript/JSX",
343+
"base_scopes": [
344+
"source.js",
345+
"source.jsx"
346+
],
347+
"color_class": "css-level-4",
348+
"scanning": [
349+
// Covers single and double quoted strings, as well as template strings
350+
"string.quoted"
351+
]
352+
},
341353
{
342354
// Setting is experimental, set "enable" to false if false positives are problematic.
343355
//

0 commit comments

Comments
 (0)