【发布时间】:2016-09-01 06:14:23
【问题描述】:
对我的 scss 文件执行代码样式有什么繁重的任务吗?
我想在我的 .scss 文件中应用代码样式,这可能吗?
所以该任务将格式化我的 css 代码,应用下面的约定,这可能吗?
我想要存档的例子
来自谷歌:
按字母顺序排列声明。 将声明按字母顺序排列,以便以易于记忆和维护的方式实现一致的代码。
background: fuchsia;
border: 1px solid;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
color: black;
text-align: center;
text-indent: 2em;
或来自惯用css:
申报顺序 如果要一致地对声明进行排序,则应遵循单一、简单的原则。
较小的团队可能更喜欢将相关属性(例如定位和盒子模型)聚集在一起。
.selector {
/* Positioning */
position: absolute;
z-index: 10;
top: 0;
right: 0;
bottom: 0;
left: 0;
/* Display & Box Model */
display: inline-block;
overflow: hidden;
box-sizing: border-box;
width: 100px;
height: 100px;
padding: 10px;
border: 10px solid #333;
margin: 10px;
/* Other */
background: #000;
color: #fff;
font-family: sans-serif;
font-size: 16px;
text-align: right;
}
谢谢。
【问题讨论】:
标签: css sass gruntjs grunt-contrib-sass