tpope/vim-haml

:hi sassClass is different from cssClassName, and is identical to cssBoxProp etc.

jsit opened this issue · 6 comments

jsit commented

In css.vim, cssClassName is linked to Function.

In sass.vim, sassClass is linked to Type.

These are the official CSS and Sass syntax files that ship with Vim.

It seems like maybe sassClass should be linked to cssClassName, or at least Function to match css.vim? Otherwise class names in CSS files and class names in Sass files can often be different colors, which could give a strange appearance if they're side-by-side.

Even without a CSS file to compare to, this highlighting for sassClass means that class names (sassClass) and CSS property names (cssBoxProp, cssTextProp, etc.) are the same color in a Sass file, which seems like it doesn't quite differentiate them enough.

screen shot 2018-05-31 at 6 29 36 pm

This screenshot from vim -u NONE -N on Vim 8.0.1450 with :color desert.

tpope commented

Looks like syntax/css.vim changed, as they definitely used to match. I agree, the Sass highlighting should be changed to bring things back in sync.

jsit commented

Would it make sense to link this to cssClassName, or does this syntax file need to be able to stand on its own?

tpope commented

Now that I look at it, we should probably handle it the same why we do sassId. The preceding punctuation mark is handled differently, but I think it looks better that way?

jsit commented

I also kind of like having the preceding punctuation mark a different color, but it's notable that this isn't the case in the css.vim file that ships. Since SCSS is a super-set of CSS, I wonder what the best way to handle this is, to keep them better in sync?

tpope commented

I am okay changing the class highlighting to match the id highlighting now, as I agree, the similarity to properties has been irking me lately too. For the punctuation mark I'd rather let that stew a bit.

jsit commented

If sassClass were linked to Identifier (like sassId), then it still wouldn't match cssClassName in the official Vim css syntax file, which is linked to Function.

Should cssClassName also be changed to Identifier? Or should sassClass and sassId both be changed to Function to match cssClassName?