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

Handle syntax highlighting of custom at-rules for Microsoft/vscode-css-languageservice#51 #140

Closed
wants to merge 2 commits into from

Conversation

octref
Copy link
Contributor

@octref octref commented Jun 14, 2018

Description of the Change

This gives some basic highlighting to unknown at-rules. The rules are modeled after @media.

For example,

@some-rule () {

}

Will now receive correct highlighting on

  • @some-rule as keyword.control.at-rule.css
  • some-rule as punctuation.definition.keyword.css
  • Everything between { and } is tokenized as normal css
  • There is no tokenization between ( and ), as we don't know the argument format for the unknown at rule

Before:

image

After:

image

Spec: https://www.w3.org/TR/css-syntax-3/#consume-an-at-rule
Related: microsoft/vscode-css-languageservice#51
Motivation: Pre-processors that define custom at-rules, for example https://github.com/css-modules/postcss-icss-values

Benefits

Better syntax highlighting of unknown css rules.

Possible Drawbacks

None.

Applicable Issues

microsoft/vscode-css-languageservice#51

@octref
Copy link
Contributor Author

octref commented Jun 18, 2018

@50Wliu Wondering if you can take a look and let me know anything I need to address. Thanks!

@octref
Copy link
Contributor Author

octref commented Jun 26, 2018

Sorry had to close in favor of #142. Was sending PR from octref/language-css:master, but now we are preparing a release from my fork's master branch.

@octref octref closed this Jun 26, 2018
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

1 participant