deplorableword / textmate-solarized

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

[Dark] [Light] [HTML] Too much italics in STYLE element. #10

Closed Zegnat closed 13 years ago

Zegnat commented 13 years ago

Currently you are setting source.css.embedded.html to italics. This is wrong. Only the tag name (style) should use italics. The way it is set-up now attributes (likes type) and the tag itself (< and >) use italics as well.

deplorableword commented 13 years ago

This issue is now fixed in light and dark, thanks for spotting it. https://github.com/deplorableword/textmate-solarized/commit/8626d5fd082a15e07a70b6e42534d59f6df022d0

Zegnat commented 13 years ago

It’s not fixed for me. The type attribute it still displayed in italics. Another clear sign of this bug is how ID selectors (#id) are being italicised.

The culprit seems to be “HTML: Embeddable” which sets source.css.embedded.html to italic. It seems this rule is used to italicise the <!-- --> used to hide CSS from ancient browsers? I’ve been toying around with it but it seems impossible to italicise only the HTML comment…

This TextMate selector was the closest I got: source.css.embedded.html - entity - meta - punctuation.

This will pass on any entity (these are attributes inside the style tag), any meta (these are all matched CSS elements, eg. selectors) and any punctuation (these match the < and > of the style tag). This is only close because it will still italicise characters within the tag that it doesn’t have other selectors for, like the = between the attribute name and value.

(Incidentally this also means the = takes on the colour set to source.css.embedded.html making it a lighter base colour than it should be.)

deplorableword commented 13 years ago

How does this look?

http://i52.tinypic.com/qznkp4.png

Zegnat commented 13 years ago

Yes, that is the only other real solution: to not italicise source.css.embedded.html at all.

It also looks like it’s a too light base colour or is that just me? Comments (in Dark) would normally be base01 (#586E75) according to Solarized Usage & Development.

(Sorry, I accidentally hit “Comment & Close”.)

deplorableword commented 13 years ago

Cool, I'll go ahead and merge in that change.

deplorableword commented 13 years ago

Just added in those changes, I've also learned you can prevent a selector from inheriting italics by setting an unsetting italics in theme editor which creates an empty fontStyle.