这具体涉及SASS的罗盘框架.
我创造了一个精灵,还有一个渐变mixin.是否可以在同一个项目上组合两个,如果是这样呢?
@import "compass/css3"; @import "icon/*.png"; @include all-icon-sprites; @mixin light-gradient { @include background-image(linear-gradient(top,$dark 20%,$light 100%)); color: $dark; text-shadow: $light; } button { @include light-gradient; @include icon-sprite(search); }
更新:
我已经提出了这个解决方案,有人可以改进吗?
@import "compass/css3"; @import "compass/utilities/sprites"; $icon: sprite-map("icon/*.png"); $light-gradient: linear-gradient(bottom,$shade-2 20%,$shade-3 100%); $icon-search: sprite($icon,search) no-repeat; button { @include background($light-gradient,$icon-search); }