Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Apr 4, 2019

Conversation

Projects
None yet
5 participants
@octref
Copy link
Contributor

commented Jun 26, 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 added some commits Jun 14, 2018

@lee-dohm

This comment has been minimized.

Copy link
Member

commented Sep 11, 2018

@50Wliu what do you think?

@50Wliu 50Wliu self-assigned this Sep 12, 2018

@nathansobo nathansobo self-assigned this Apr 4, 2019

@nathansobo

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

Thanks very much!

@nathansobo nathansobo merged commit 6abc0a2 into atom:master Apr 4, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.