Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Distinguishing words that are both selectors and properties #266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Distinguishing words that are both selectors and properties #266

wants to merge 1 commit into from

Conversation

cssinate
Copy link

@cssinate cssinate commented Aug 16, 2019

Description of the Change

The words "content" "cursor" "filter" "font" and "mask" are all words that have been identified as selectors (https://github.com/atom/language-css/blob/master/grammars/css.cson#L2056) and property names (https://github.com/atom/language-css/blob/master/grammars/css.cson#L1488).

This code change targets specifically those words. In this change, these words are considered property names by default, but once they're followed by a curly brace, pseudo-element or pseudo-selector, they resolve to selectors.

Alternate Designs

This was attempted previously in #234, but that caused other issues.

Benefits

Syntax highlighters will now properly highlight this words.

Possible Drawbacks

The only one I could find is that if you type one of these words in the main body of the CSS file, it will first assume it's a property name, and only update it to a selector after the curly brace gets added, contrary to how other selectors are added.

Applicable Issues

#226

@rsese
Copy link

rsese commented Aug 19, 2019

Thanks @cssinate! I see from the issue you mentioned:

I don't know enough about the tests to understand what they're complaining about. It seems like it breaks because it doesn't like the name or the scope that font has. However, font is both a valid property name and a valid (though deprecated) HTML tag. If someone has some insight about where we can go from here, I'm all for it!

Though a maintainer might take a look here, the best place to get help with test issues is probably the Atom Slack. There are a bunch of helpful folks there that should be willing to help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants