延长我有三个SASS文件(包括所有必要的进口):SASS:将在混入
- 头
- 变量
- 精灵
变量我有:
@mixin svg-sprite($sprite) {
@extend .{$sprite};
@extend .{$sprite}-res;
}
我在打电话:
@include svg-sprite(".logo");
和精灵:
%svg-common {
background: url("svg/sprite.view.svg") no-repeat;
}
.logo {
@extend %svg-common;
background-position: 0 58.3969465648855%;
}
.logo-res {
width: 180px;
height: 80px;
}
,但我得到的错误:
Error: Invalid CSS after " @extend": expected selector, was ".{$sprite};"
on line ** of ****.scss
>> @extend .{$sprite};
什么,我做错了什么?
@Harry也许有什么解决办法忘记
#
? 使用我的精灵? – brabertaser19对不起,我先前的评论。我立场纠正。下面给出的答案适用于我,似乎Sass确实支持它。 – Harry