-
-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Description
CSS Modules have a class composition feature which acts similarly to LESS’ :extend() rule. It is enabled by the composes property. The problem is that the class referenced by this property is not processed by postcss-loader.
Example:
/* a.css */
.a {
display: flex;
}
/* b.css */
.b {
composes: a from "./a.css";
user-select: none;
}/* Webpack config */
module.exports = {
module: {
loaders: [
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader?modules&localIdentName=[name]--[local]--[hash:base64:5]', 'postcss-loader']
}
]
},
postcss: function () {
return [autoprefixer({ browsers: ['last 2 versions'] })];
}
};With autoprefixer added, the code is compiled to the following:
/* b.css */
.b {
display: flex;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}As you see, the user-select property is processed and prefixed, whereas display: flex is not.
Metadata
Metadata
Assignees
Labels
No labels