关注前端开发
关注用户体验

Sublime Text 3的Less2Css插件介绍与安装

在介绍Less2Css之前我们先安装一个less的语法高亮,用LESS的同学都知道,sublime没有支持less的语法高亮,所以这个插件可以帮上我们,可以直接安装ctrl+shift+p>install Package搜索less按Enter就可以了,或者到这里下载,安装成功后,重启sublime

下面安装Less2Css,跟上面一样ctrl+shift+p>install Package搜索Less2Css按Enter就可以安装了,Less2Css插件依赖lessc这个工具,在windows下可以下载或者用git cloneless.js-windows到本地目录。然后把目录地址加入到环境变量PATH的中,如D:\less.js-windows-master:

win10

设置好之后,通过快捷键 Windows徽标键+R键 调出运行窗口,输入cmd,在命令行中输入lessc,如果有如下提示则表示设置成功:

C:\Users\Fdream>lessc
lessc.wsf: no input files
Usage:
Single file: cscript //nologo lessc.wsf input.less [output.css] [-compre
Directory: cscript //nologo lessc.wsf inputdir outputdir [-compress]

(上面的这个步骤有时候cmd时会出现错误,打印不出来,可以略过)

这时关掉Sublime Text 3再重新打开就可以在Sublime Text 3中打开或者新建一个less文件,按下Ctrl+S保存,此时应该会在less文件的相同目录下生成同名的css文件。

来段代码试试吧:

@width:300px;
@fonts:12px bold 'Source Code Pro', Menlo, Consolas, Monaco, monospace;
.header{
color:#5c5c5c;
.title{
font:@fonts;
width:@width;
}
.content{
width:@width;
height:300px;
}
}
.footer{
font:@fonts;
width:@width + 100px;
}
赞(2)
未经允许不得转载:大前端 » Sublime Text 3的Less2Css插件介绍与安装
分享到: 更多 (0)

评论 15

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #15

    Hey there! I simply wish to offer you a huge thumbs up for your excellent info you have got right here on this post. I am coming back to your web site for more soon.

  2. #14

    Enjoyed the post.

  3. #13

    Keep up the good work! Thanks.

  4. #12

    I truly wanted to write a brief note so as to say thanks to you for the stunning secrets you are sharing here. My extensive internet investigation has at the end of the day been paid with pleasant suggestions to share with my friends and family. I would repeat that we readers actually are unequivocally blessed to live in a very good network with many brilliant individuals with very helpful techniques. I feel somewhat grateful to have encountered your entire webpages and look forward to some more pleasurable minutes reading here. Thank you once more for everything.

  5. #11

    I truly wanted to write a brief note so as to say thanks to you for the stunning secrets you are sharing here. My extensive internet investigation has at the end of the day been paid with pleasant suggestions to share with my friends and family. I would repeat that we readers actually are unequivocally blessed to live in a very good network with many brilliant individuals with very helpful techniques. I feel somewhat grateful to have encountered your entire webpages and look forward to some more pleasurable minutes reading here. Thank you once more for everything.

  6. #10

    I truly wanted to write a brief note so as to say thanks to you for the stunning secrets you are sharing here. My extensive internet investigation has at the end of the day been paid with pleasant suggestions to share with my friends and family. I would repeat that we readers actually are unequivocally blessed to live in a very good network with many brilliant individuals with very helpful techniques. I feel somewhat grateful to have encountered your entire webpages and look forward to some more pleasurable minutes reading here. Thank you once more for everything.

  7. #9

    Keep up the good work! Thanks.

  8. #8

    Nice post! Thank you.

  9. #7

    I simply had to say thanks yet again. I do not know the things I would have made to happen in the absence of those ways contributed by you relating to such a theme. It previously was a real terrifying circumstance in my circumstances, but noticing your specialized fashion you processed the issue forced me to jump with gladness. I’m happy for your information and then believe you comprehend what a powerful job that you’re getting into educating some other people through the use of a web site. I know that you have never come across any of us.

  10. #6

    Enjoyed the post.

  11. #5

    Nice post! Thank you.

  12. #4

    Keep up the good work! Thanks.

  13. #3

    Nice post! Thank you.

  14. #2

    Thanks , I have recently been looking for info approximately this subject for a long time and yours is the best I’ve discovered till now. But, what about the conclusion? Are you sure concerning the source?

  15. #1

    Thanks, I’ve recently been looking for information approximately this subject for ages and yours is the greatest I’ve came upon so far. However, what in regards to the conclusion? Are you sure about the supply?

    Moriah Shamily1个月前 (03-11)回复

themebetter 国内更好的WordPress主题服务商

立即前往