I want to define certain rules in a custom syntax definition for custom functions in CSS (like paint() function which is not highlighted by the default CSS syntax) but at the same time I don’t want to lose the default CSS syntax. Is there any way to have the CSS syntax shipped by ST and also define my own custom rules for a .css file ?
How to use a default syntax while defining extra rules
0 Likes
bschaaf
#2
You’ll need to override the default syntax with a copy that adds the syntax scopes where you want them. If you want custom colors on those you’ll also need to have your own/override an existing color scheme.
0 Likes
Isn’t there a way to “extend” an existing syntax ? I have read in the docs about pushing in an existing syntax in case of templating languages. Is it possible for pushing an existing syntax & then just define the rules I need ?
0 Likes
bschaaf
#4
You can push an existing syntax, but the only way to modify it’s behaviour is through the prototype. You could do this, but having a prototype that matches paint( will match that wherever it is, including in comments and strings, so such a solution is far from ideal.
0 Likes