zoukankan      html  css  js  c++  java
  • sass编译

    sass编译

    命令行编译

    单文件转换命令

    sass style.scss style.css

    单文件监听命令

    sass --watch style.scss:style.css

    文件夹监听命令

    sass --watch sassFileDirectory:cssFileDirectory

    css文件转成sass/scss文件(在线转换工具css2sass

    sass-convert style.css style.sass   
    sass-convert style.css style.scss
    

    命令行其他配置选项

    运行命令行帮助文档,可以获得所有的配置选项

    sass -h

    我们一般常用的有--style--sourcemap--debug-info等。

    sass --watch style.scss:style.css --style compact
    sass --watch style.scss:style.css --sourcemap
    sass --watch style.scss:style.css --style expanded --sourcemap
    sass --watch style.scss:style.css --debug-info
    
    • --style表示解析后的css是什么格式,有四种取值分别为:nestedexpandedcompactcompressed
    • --sourcemap表示开启sourcemap调试。开启sourcemap调试后,会生成一个后缀名为.css.map文件。
    • --debug-info表示开启debug信息,升级到3.3.0之后因为sourcemap更高级,这个debug-info就不太用了。

    四种style生成后的css

    // nested
    #main {
      color: #fff;
      background-color: #000; }
      #main p {
        width: 10em; }
    
    .huge {
      font-size: 10em;
      font-weight: bold;
      text-decoration: underline; }
    
    // expanded
    #main {
      color: #fff;
      background-color: #000;
    }
    #main p {
      width: 10em;
    }
    
    .huge {
      font-size: 10em;
      font-weight: bold;
      text-decoration: underline;
    }
    
    // compact
    #main { color: #fff; background-color: #000; }
    #main p { width: 10em; }
    
    .huge { font-size: 10em; font-weight: bold; text-decoration: underline; }
    
    // compressed
    #main{color:#fff;background-color:#000}#main p{10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}

    gui编译

    这里推荐koala,它是一个优秀的免费编译器,界面清晰简洁,操作起来也非常简单,详细的大家可以移歩到:Less/Sass编译工具,koala使用指南,简单操作如下图:

    koala compile

    编辑器编译

    某些高上大的编辑器本身就内置了sass的编译,如webstorm等,而对于sublime text也有相应的插件可以使用:编译保存即编译。如果不清楚你的编辑器是否拥有自动编译的功能,可谷歌百度。

    在线编译

    sassmeister提供了在线编译。

    文章内容源于网络

  • 相关阅读:
    Python三维绘图--Matplotlib colorbar生成
    Python三维绘图--Matplotlib
    VIM剪切板的使用
    三维点云网络PointNet——模型及代码分析
    ECCV2018--点云匹配
    hdu 1905 小数化分数2
    hdu 1755 A Number Puzzle
    hdu 1796 How many integers can you find
    hdu 1452 Happy 2004
    hdu 2837 Calculation
  • 原文地址:https://www.cnblogs.com/xinlecnblogs/p/6091167.html
Copyright © 2011-2022 走看看