Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自动生成雪碧图css的功能 #30

Open
cos2004 opened this issue Aug 26, 2016 · 2 comments
Open

自动生成雪碧图css的功能 #30

cos2004 opened this issue Aug 26, 2016 · 2 comments

Comments

@cos2004
Copy link

cos2004 commented Aug 26, 2016

处理icons时,一般都是切图、写sass,遇到icon(最近的一个项目130个icon)比较多的情况下比较花时间去写这部分sass,不知道雅典娜能不能提供自动合并_icons.scss的功能,通过@import引入自动合并好的样式文件。比如:images/icons/aaa.png,images/icons/bbb.png,images/icons/bbb_disabled.png,自动监控文件增删,自动合并为_icons.scss :

$icons: sprite-map("icons/*.png", $spacing:10px); 
.aaa { 
    display: inline-block; 
    @include s2b($icons, "aaa"); 
} 
.bbb { 
    display: inline-block; 
    @include s2b($icons, "bbb"); 
    &_disabled { 
        @include s2b($icons, "bbb_disabled"); 
    } 
}

这样就省略了“手写雪碧图css”的步骤。
这些icon的css不包含其他属性,如果需要其他属性还要在另外的css文件里写。
当然这些sass是用compass的sprite-map,用“__sprite”也是可以的

@luckyadam
Copy link
Member

soga,可以加入

@cos2004
Copy link
Author

cos2004 commented Aug 30, 2016

问了一下组内同学,他们的书写习惯不是这样的,这个需求可能有一定的个人习惯性吧。。。所以觉得这个优先级不高,先完善其他的功能吧 @luckyadam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants