deplorableword / textmate-solarized

TextMate theme for Solarized
http://ethanschoonover.com/solarized
440 stars 98 forks source link

Javascript, HTML Javascript or both? #12

Open Zegnat opened 13 years ago

Zegnat commented 13 years ago

I was just looking at the canonical Vim screenshots of Solarized and noticed there are 2 different versions of Javascript syntax highlighting in the original.

Javascript within HTML (screenshot dark, light) is based on orange while standalone Javascript (screenshot dark, light) is based on a base colour.

Should this TextMate port support both variants or are we going to choose one? My guess is @altercation did not specify colours for those elements that switch colour and has a base grey as default colour for standalone but orange as default colour for embedded scripts. That would mess things up.

deplorableword commented 13 years ago

Interesting, do you know if TextMate supports additional selectors for embedded JS vs a JS document?

Zegnat commented 13 years ago

do you know if TextMate supports additional selectors for embedded JS vs a JS document?

Any selector chain starting with source.js.embedded.html will target embedded JS and any starting with source.js will target JS documents only. So yes, this allows you to style them differently.

Elements that have the same colour no matter the context, like if(), can be styled by leaving out a parent selector. So styling keywords like that green you would only use keyword.control.js as selector to target it in both cases at once.

Functions have a different colour depending on context so you would make source.js.embedded.html support.function.js orange and make source.js support.function.js grey. (Or you define no colour for them at all and just set source.js.embedded.html to orange and source.js to grey.)