Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sublime Text 3配置Less #9

Open
holyzfy opened this issue Oct 11, 2016 · 0 comments
Open

Sublime Text 3配置Less #9

holyzfy opened this issue Oct 11, 2016 · 0 comments

Comments

@holyzfy
Copy link
Owner

holyzfy commented Oct 11, 2016

最终效果

保存.less文件时会当前目录下生成同名的css文件,并且自动给css3属性打前缀

安装说明

  1. 安装sublime-less2css

  2. 安装less-plugin-autoprefix

  3. 菜单Preferences > Package Control: Install Package,依次安装

    • Less
    • Less2Css
  4. 菜单Preferences > Settings > Less2Css > Settings - User,增加

    {
        "lesscCommand": "{{lessc_path}}",
        "minify": false,
        "autoprefix": true
    }

    在终端里运行which lessc,把输出的内容替换掉上面的{{lessc_path}}

测试一下吧

新建文件test.less,内容如下:

.test {
    margin: 0;
    font-size: 14px;
    .item {
        display: flex;
        line-height: 1.5;
    }
}

保存less后查看当前目录下生成的demo.css

@holyzfy holyzfy changed the title Sublime text 3配置less Sublime Text 3配置less Oct 11, 2016
@holyzfy holyzfy changed the title Sublime Text 3配置less Sublime Text 3配置Less Oct 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant