Bourbon: 让你的sass更简洁
生活随笔
收集整理的這篇文章主要介紹了
Bourbon: 让你的sass更简洁
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Bourbon是什么
bourbon是一個(gè)輕量級(jí)的Sass mixin和函數(shù)庫(kù),可以幫助我們快速開(kāi)發(fā)樣式.
官方文檔
以下用webpack@3.10.0( vue)為示例簡(jiǎn)述Bourbon的使用
安裝配置
舉例使用
position
.test {@include position(relative, 0 null null 30px); }生成的樣式
.test[data-v-a49090ce] {position: relative;top: 0;left: 30px; }ellipsis
.test {@include ellipsis; }生成的樣式
.test[data-v-a49090ce] {display: inline-block;max-width: 100%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;word-wrap: normal; }px to rem
.test {font-size: rem(120); }生成的樣式
.test[data-v-a49090ce] {font-size: 1.6rem; }shade
.test {background-color: shade(blue, 60%); }生成的樣式
.test[data-v-a49090ce] {background-color: #000066; }prefixer(不受類似postcss的autoprefixer工具影響的情況下)
.test {@include prefixer(appearance, none, ("webkit")); }生成的樣式
.test[data-v-a49090ce] {-webkit-appearance: none }更多請(qǐng)前往官方文檔查看
更多專業(yè)前端知識(shí),請(qǐng)上 【猿2048】www.mk2048.com
總結(jié)
以上是生活随笔為你收集整理的Bourbon: 让你的sass更简洁的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 前端生态混乱,AMPMIP在努力做标准化
- 下一篇: 浅谈一下我了解的PWA