Skip to content

scss: Unknown property when using :export, CSS Modules #103

@mbullington

Description

@mbullington

Hello!

I'm using a fairly normal Webpack + PostCSS + CSS Modules setup, and one of the features of CSS Modules is that any properties under the tag :export are exported as part of the imported Webpack file.

Example:

:export {
  myColor: red;
}
import styles from . . .

styles.myColor; // red

Currently I get an error message Unknown property: 'myColor' which makes sense as its not in the CSS or Sass specs, but I don't want to have to disable the entirety of CSS Language Features to not see these warnings;

The same thing happens for the composes property of CSS Modules, which you can use like so . . .

.a {
  background-color: red;
}

.b {
  composes: a;
  color: white;
}

This feature is less important since nearly all CSS preprocessors support some sort of inheritance.

Is better integration with CSS Modules something you'd be willing to support? Perhaps these features could only be enabled if the file ended with .mod.css, .mod.scss, etc.

Thank you!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions