【发布时间】:2015-07-09 21:57:23
【问题描述】:
有没有办法按照某些标准对 Stylus 文件中的行进行排序,例如按字母顺序,还是按规则域,比如,所有背景的东西一个接一个地放,然后都是定位的东西,比如top,right等等?
当然,这些行应该保留在它们的父元素内。
这是一个例子:
#topbar
clearfix()
position fixed
height topBarHeight
border-bottom 1px solid rgba(#fff, 0.2)
box-sizing border-box
z-index 200
right 0
left 0
可以变成这个,按域分组:
#topbar
// mixins
clearfix()
// positioning and sizing
position fixed
z-index 200
left 0
right 0
box-sizing border-box
height topBarHeight
// border
border-bottom 1px solid rgba(#fff, 0.2)
// the rest
...
这是一种完美主义之痒,但将所有文件内容按某种顺序排列会很酷。
【问题讨论】:
标签: html css sorting coding-style stylus