日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Bourbon: 让你的sass更简洁

發布時間:2023/12/2 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Bourbon: 让你的sass更简洁 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Bourbon是什么

bourbon是一個輕量級的Sass mixin和函數庫,可以幫助我們快速開發樣式.

官方文檔

以下用webpack@3.10.0( vue)為示例簡述Bourbon的使用

安裝配置

  • npm install bourbon -S
  • 把bourbon添加到node-sass的includePaths中// webpack.config.js module.exports = {entry: {},output: {},module: {"rules": [{test: /\.scss$/,use: ["vue-style-loader",{loader: "css-loader",options: {...}},{loader: "postcss-loader"},{loader: "sass-loader",options: {..."includePaths": [require("bourbon").includePaths]}}]}]} }
  • 在sass/scss文件中引用@import "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 }
  • 更多請前往官方文檔查看


    更多專業前端知識,請上 【猿2048】www.mk2048.com

    總結

    以上是生活随笔為你收集整理的Bourbon: 让你的sass更简洁的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。