一直在页面写css, 重复写着样式,发现布局中,特别是h5,大量的样式都是margin,padding,width,height, 而,当我们需要给一个标签写样式的时候,避免内联样式,我们又需要取class名,对于英语不是特别好的同学,可能会特别苦恼。好了,有了这款插件,这些都不是问题!
module.exports = {
// ...
plugins: [
new happycss({
// csspath: './src/assets/css/happycss.css'
// importpath: './src/main.js'
}),
]
}
写法 | 生成 |
class="w10" | .w10 { width: 10px } |
class="w10p" | .w10 { width: 10% } |
class="h10" | .h10 { height: 10px } |
class="mt10" | .mt { margin-top: 10px } |
class="pt10" | .pt { padding-top: 10px } |
class="lh10" | .lh10 { line-height: 10px } |
网友评论