Sublime Forum

CSS Syntax Highlighting

#1

Hi there,

I just thought I’d check up on something before raising a bug (see if it’s something related to my theme, rather than the system) but I don’t think the CSS syntax highlighting is working quite right.

I’m using the Twilight theme and the ids and classes aren’t being highlighted the way I expect them to be.

http://i.imgur.com/wkJaD.png (Comparison is TextMate… Sorry that it always comes down to comparing this to another editor, I do appreciate Sublime on it’s own merits!)

I just wondered if this is something I’ve changed (and broken) or the expected behaviour…

Thanks!

Dom

0 Likes

#2

Have you compared the scopes too? If you’re using the same color scheme and the same tmLanguage file, I’d say you’d have to see the same result.

0 Likes

#3

This definitions are working for me in ST:

name CSS: .class scope entity.other.attribute-name.class.css settings foreground #152b70 name CSS: #id scope entity.other.attribute-name.id.css settings foreground #3c2896
0 Likes

#4

Thanks for your comments!

I’ve got it working now, but I had to modify the Twilight.tmTheme. I also stumbled upon this post when I searched for the scope name and the changes appear to be differences in the weighting of the selectors. If anyone is interested I changed the following lines in Twilight.tmTheme:

Line 350: <string>source.css meta.selector.css entity.other.attribute-name.tag.pseudo-class.css</string>
Line 361: <string>source.css meta.selector.css entity.other.attribute-name.id.css</string>
Line 372: <string>source.css meta.selector.css entity.other.attribute-name.class.css</string>

to make the scope selectors more specific (at least, I assume that’s what I did…!)

Thanks for the pointers!

0 Likes