老大之前让我学sass、compass,说sass可以让代码看起来更高大上。但经过学习之后没有感觉到,因为sass最终还是要编译成css才能用,有时还会让代码看起来很冗余。不知各位前辈有什么感悟和建议?
2 回答
繁花如伊
TA贡献2012条经验 获得超12个赞
使用SASS只是为了提高编写CSS的效率,能够重复使用很多相同的样式,而且定义好变量之后,以后如果要个性的话也能够很方便,只需要个性一个变量的值,其他用到的地方就会都改变啦~
30秒到达战场
TA贡献1828条经验 获得超6个赞
//variables$js:'../js/';$img:'../img/';$icons-sprite-path:'../img/';$base-width:1000px;//arandomid$version:unique-id();//top$top-background:#f5f5f5;$top-bottom-background:#595959;$top-bottom-highlight-background:#cc0000;$top-border-color:#383838;$highlight-background:#d33737;$table-th-background:#e5e5e5;//button$button-default-background:#9c9c9c;$button-primary-background:#0776b7;$button-lesser-background:#c4deed;$button-danger-background:#e85151;$button-blue-background:#a8dbf9;$button-gray-background:#eee;@mixininline-block(){display:inline-block;*display:inline;*zoom:1;}//wrapper@mixinwrapper($width:$base-width){width:$width;min-width:$width;margin:0auto;}类似这样,到时候修改起来就很方便了。
添加回答
举报
0/150
提交
取消
