Vscode: CSSnext & preCSS Support

Created on 9 Mar 2016  路  11Comments  路  Source: microsoft/vscode

Please add CSSnext & preCSS Support
When using cssnext in combination with precss a lot of warning are given concerning expected braces or semicolons when nesting. This leads to a lot of red stripes and color theme being completely off.

Configuration is:
CSSnext (through PostCSS)

  • PreCSS for Sass-like nesting

schermafbeelding 2016-03-09 om 11 08 21

feature-request

Most helpful comment

using the ricard.PostCSS plugin provides correct syntax highlighting for .pcss, .postcss files.

you can then associate .css files to be treated as .pcss files in your settings, and you'll get the correct syntax highlighting:

"files.associations": {
  "*.css": "postcss"
}

Note: this method will completely disable IntelliSense & validation, as postcss is not a known target.

All 11 comments

Yeah, we would _really_ like this too...

Obviously it makes no sense to talk about adding syntax support for PostCSS, as that is nothing more than a task runner and could theoretically support any syntax, but it would be really great to have an option to at least enable support for the subset of future css syntax supported by CSSNext (http://cssnext.io/features).

Our design/css/html guys work in Sublime Text and they absolutely insist on using PostCSS with CSSNext - which is fine, except that the mess of red squiggles the rest of us see in VS Code is really getting in the way of collaboration. Is this something you would consider supporting in the near future?

@thomas-darling Does it help to disable the built-in CSS validation using "css.validate": false and then use one of the CSS linter extensions, e.g., https://marketplace.visualstudio.com/items?itemName=shinnn.stylelint?

The former will certainly help but the highlighting is off too. I see this as the domain for a community extension.

Has there been any progress on this front by chance?

I need proper cssnext support 馃憤

Adding a user setting that allows you to enable future CSS spec validation, would be a helpful and logical way to support CSSNext.

Assigning to @aeschli, there are some recent CSS improvements.

Recently I added support for variables, for @apply and custom property to the base CSS support.

In general we only adopt css specs when they become widely adopted and supported by all the major browsers. There are a lot of proposed specs out there. You can imagine that it's takes a lot of time to study, adopt the parser and get it right.

Please file specific requests for features to support. The current issue (add support for CSSNext and preCSS) is too broad to take action on.

Also, if you don't want to wait: Write an extension that adds the missing features. Or make a pull requests. https://github.com/Microsoft/vscode-css-languageservice is the repository for the css language support.

using the ricard.PostCSS plugin provides correct syntax highlighting for .pcss, .postcss files.

you can then associate .css files to be treated as .pcss files in your settings, and you'll get the correct syntax highlighting:

"files.associations": {
  "*.css": "postcss"
}

Note: this method will completely disable IntelliSense & validation, as postcss is not a known target.

As mentioned, please file specific issues if you want the css support to catch up on a new css spec.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vsccarl picture vsccarl  路  3Comments

mrkiley picture mrkiley  路  3Comments

DovydasNavickas picture DovydasNavickas  路  3Comments

sirius1024 picture sirius1024  路  3Comments

lukehoban picture lukehoban  路  3Comments