Sass

  • Sass中文网:https://www.sass.hk/
  • 在线预览:https://www.sassmeister.com/

1 案例 

1.1 定义变量

Sass_第1张图片

1.2 嵌套写法

Sass_第2张图片

 

 

 

Sass_第3张图片

Sass_第4张图片

Sass_第5张图片


2 vue集成sass

2.1 在项目中安装sass

λ vue --version
@vue/cli 4.3.1
cnpm install node-sass --save-dev
cnpm install sass-loader --save-dev
"dependencies": {
  "core-js": "^3.6.4",
  "vue": "^2.6.11"
},
"devDependencies": {
  "node-sass": "^4.14.1",
  "sass-loader": "^8.0.2",
  "@vue/cli-plugin-babel": "~4.3.0",
  "@vue/cli-plugin-eslint": "~4.3.0",
  "@vue/cli-service": "~4.3.0",
  "babel-eslint": "^10.1.0",
  "eslint": "^6.7.2",
  "eslint-plugin-vue": "^6.2.2",
  "vue-template-compiler": "^2.6.11"
}

2.2 使用sass

Sass_第6张图片



 

https://www.jianshu.com/p/f6af30ee21a2

你可能感兴趣的:(vue)