Fail to using extend feature from less
I wanna using extend feature , like this:
.flexBox {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: flex;
}
header {
.flexBox
}
But got error msg like this :
Module build failed: ModuleError: CssSyntaxError:
house-list.less:20:5: Unknown word
header {
.flexBox;
^
with my webpack.config.js
...
module: {
loaders: [
{ test: /\.vue$/, loader: vue.withLoaders({
css: ExtractTextPlugin.extract(
"style-loader", "css-loader?sourceMap!less!cssnext-loader")
}),
},
{ test: /\.less$/, loader: ExtractTextPlugin.extract(
"style-loader",'css-loader?sourceMap!less!cssnext-loader')
},
{ test: /\.css$/, loader: ExtractTextPlugin.extract(
"style-loader", "css-loader?sourceMap!cssnext-loader")
},
{ test: /\.(jpg|png|gif)$/, loader: "file-loader?name=images/[hash].[ext]"},
{ test: /\.(html|tpl)$/, loader: 'html-loader' }
]
},
...
How would I do this?
Yes I'm getting a similar error. The worst part is that lessc directly form the command line works perfectly. Unclear why less-loader doesn't work just like lessc...
As a quick fix, just use autoprefixer for this kind of stuff. Have you tried setting a mixin, and then calling it? That's working correctly for me
This doesn't work.
/ The micro clearfix http://nicolasgallagher.com/micro-clearfix-hack/
.clearfix() {
*zoom:1;
&:before,
&:after {
content:"";
display:table;
}
&:after {
clear:both;
}
}
body {
width: 100%;
.clearfix;
}
also doesn't work &:extend(.class) between 2 files
file1.less
.text {
&__size {
height: 100px;
}
}
file2.less
.class {
&:extend(.text__size);
}
main.less
@import "file1.less";
@import "file2.less";
Also getting this issue trying to use mixins. Any update?
Sorry, there is not enough information to reproduce this. Please provide a minimal test repository that demonstrates the problem so I can check that out. Try to remove as much stuff as possible since it helps tracking down the problem.
I'll re-open the issue then.
Same problem here :(
Same problem. Both extend and mixin cannot be used