fix(grammar): support bare property declarations at top level#50
Open
rhukster wants to merge 1 commit intomicrosoft:mainfrom
Open
fix(grammar): support bare property declarations at top level#50rhukster wants to merge 1 commit intomicrosoft:mainfrom
rhukster wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Add `#rule-list-innards` to the top-level patterns array to enable proper syntax highlighting for CSS custom properties (variables) when used outside of rule blocks. This fixes an issue where code blocks containing bare CSS variable declarations (e.g., `--my-color: #fff;`) are incorrectly marked as invalid syntax. This is particularly useful for documentation and code examples that show individual property declarations without surrounding selectors. Example that now highlights correctly: ```css --primary-color: #3498db; --secondary-color: rgb(52, 73, 94); color: var(--primary-color); ```
Contributor
|
Hi @rhukster, Where or when is this valid syntax in standard CSS? |
Contributor
|
@rhukster Can you open an issue to give more details on your use case? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add
#rule-list-innardsto the top-level patterns array to enable proper syntax highlighting for CSS custom properties (variables) when used outside of rule blocks.This fixes an issue where code blocks containing bare CSS variable declarations (e.g.,
--my-color: #fff;) are incorrectly marked as invalid syntax. This is particularly useful for documentation and code examples that show individual property declarations without surrounding selectors.Example that now highlights correctly: