billymoon / Stylus

Stylus Package for Sublime Text 2 / 3
Other
129 stars 31 forks source link

font is not recognized as a css property #35

Closed ghost closed 10 years ago

ghost commented 10 years ago

using default sublime settings, "font" is not being converted to a css property (blue color, italicized)

image

grassator commented 10 years ago

I've added workaround for you case but the problem is that font is a valid tag and a valid property. That means that following declarations in stylus can mean two different things:

font span
font:empty

That comes from a fact that colon is optional in stylus while font name can be any valid identifier even in CSS so you could have fonts named "span" or "empty".

The only way to truly distinguish between those is to rely on indentation (and / or curly braces) to determine if there are some nested expression after the line in question. Unfortunately such complicated parsing is impossible with Sublime grammar syntax.

If problem persists for many user I consider will removing support for font tag completely because it's very rarely used in real stylesheets.

jemware commented 10 years ago

I am now getting strange highlighting results with font related properties when using variables as values:

screenshot 2014-08-08 09 44 28

ctalkington commented 10 years ago

ditto on the weird results. image