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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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