首页 > 代码库 > ionic添加scss

ionic添加scss

Setup Sass Automatically

在进行以下操作之前要确保node比较新,以便正确安装node-sass 或
改用cnpm install node-sass安装(淘宝源)
$ ionic setup sass
Setup Sass Manually
在执行npm install之前确保执行零npm install -g 先安装全局,再安装本地
  1. Run npm install from the working directory of an Ionic project. This will install gulp.js and a few handy tasks, such as gulp-sass andgulp-minify-css.
  2. Remove <link href=http://www.mamicode.com/"lib/ionic/css/ionic.css" rel="stylesheet"> from the <head> of the root index.html file.
  3. Remove <link href=http://www.mamicode.com/"css/style.css" rel="stylesheet"> from the <head> of the root index.html file.
  4. Add <link href=http://www.mamicode.com/"css/ionic.app.css" rel="stylesheet"> to the <head> of the root index.html file.
  5. In the ionic.project file, add the JavaScript property "gulpStartupTasks": ["sass", "watch"] (this can also be customized to whatever gulp tasks you’d like).

 

ionic添加scss