为了账号安全,请及时绑定邮箱和手机立即绑定

sass如何让css代码看起来高大上?

sass如何让css代码看起来高大上?

慕田峪4524236 2019-04-10 20:49:08
老大之前让我学sass、compass,说sass可以让代码看起来更高大上。但经过学习之后没有感觉到,因为sass最终还是要编译成css才能用,有时还会让代码看起来很冗余。不知各位前辈有什么感悟和建议?
查看完整描述

2 回答

?
繁花如伊

TA贡献2012条经验 获得超12个赞

使用SASS只是为了提高编写CSS的效率,能够重复使用很多相同的样式,而且定义好变量之后,以后如果要个性的话也能够很方便,只需要个性一个变量的值,其他用到的地方就会都改变啦~
                            
查看完整回答
反对 回复 2019-04-10
?
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;
}
类似这样,到时候修改起来就很方便了。
                            
查看完整回答
反对 回复 2019-04-10
  • 2 回答
  • 0 关注
  • 380 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号