vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 594 forks source link

Syntax checking to auto-detect PostCSS in <style> #2556

Open privatenumber opened 3 years ago

privatenumber commented 3 years ago

Feature Request

I'm getting syntax errors in the <style> block on nested CSS rules and it seems the expected solution here is to add lang="postcss".

However, this is confusing because vue-loader docs say:

There's no need to specify lang="postcss" on a style block if there is a PostCSS config file in your project.

I'd like to request that Vetur implicitly determines whether the syntax is PostCSS, by detecting:

yoyo930021 commented 3 years ago

which files postcss-loader is applied to

This can't be done because vetur has no way of knowing your webpack config.

if there's a PostCSS config file: postcss.config.js, .postcssrc.js, etc.

This may be possible. Welcome a PR.

blowsie commented 3 years ago

For what its worth, adding lang="postcss" breaks the deep selectors in storybook-vue