postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
597 stars 77 forks source link

8.0.0 #132

Closed jonathantneal closed 5 years ago

jonathantneal commented 5 years ago

New features

Removed features

Resolves

Resolves #80 Resolves #100 Resolves #102 Resolves #109 Resolves #113 Resolves #122 Resolves #124 Resolves #125 Resolves #129 Resolves #131


With this update, all of the “custom” plugins (Custom Properties, Custom Selectors, and Custom Media) will be able to import and export variables to and from CSS, JS, and JSON files.

These features and some fixes resolve every open single issue in the repository. Namely, this update resolves the issue with Webpack users needing to reference variables from a single, master file.

This update also allows communication from PostCSS to client-side libraries that want to reference custom properties, selectors, or media in JS. This update also allows communication to PostCSS from design apps that can export master files of custom properties, selectors, and media themselves.

pascalduez commented 5 years ago

Removed: warnings and noValueNotifications options, as this should be the job of a linter tool.

Not sure a linter will be able to properly check all of this, especially for cases where the custom properties are defined in separate files, or imported from JS.

jonathantneal commented 5 years ago

@pascalduez, I’ll look into it, but this could also be added in a future minor if there is significant demand. Otherwise, linters should add similar importFrom functionality; this would be especially true for postcss-preset-env users, who might skip running this plugin altogether based upon their browserslist.

pascalduez commented 5 years ago

this would be especially true for postcss-preset-env users, who might skip running this plugin altogether based upon their browserslist.

Good point! :)

gpoitch commented 5 years ago

@jonathantneal @pascalduez adding my +1 to bring back the warnings option even though it probably should be a linter responsibility. Looked into using stylelint led to a dead end: https://github.com/stylelint/stylelint/issues/2220

pascalduez commented 5 years ago

@gpoitch I'll give a try at creating a stylelint plugin, makes me quite curious.

jonathantneal commented 5 years ago

@gpoitch, @pascalduez, that poor issue was opened before its time. 😞

jonathantneal commented 5 years ago

If it helps, I spent some time tonight trying to learn how one writes a stylelint plugin. Maybe this is an okay template?

https://github.com/csstools/stylelint-value-no-unknown-custom-properties

jonathantneal commented 5 years ago

@pascalduez, @gpoitch. I’ve published the plugin.

https://github.com/csstools/stylelint-value-no-unknown-custom-properties