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

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)

评论 23

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

    Very good post. I’m going through some of these issues as well..

  2. #22

    Thank you so much for this!

  3. #21

    hi!,I love your writing very much! share we communicate extra approximately your post on AOL?
    I require a specialist in this house to unravel my problem.
    May be that is you! Having a look forward to see you.

    junxin jewelry3周前 (06-05)回复
  4. #20

    Can I just say what a relief to search out somebody who really is aware of what theyre speaking about on the internet. You undoubtedly know how to deliver a problem to light and make it important. Extra folks need to learn this and perceive this facet of the story. I cant consider youre no more common because you positively have the gift.

    Christen Curlee1个月前 (05-14)回复
  5. #19

    Hmm it looks like your blog ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to the whole thing. Do you have any helpful hints for rookie blog writers? I’d definitely appreciate it.

    Nonton Anime2个月前 (05-10)回复
  6. #18

    We are a gaggle of volunteers and opening a brand new scheme in our community. Your website provided us with useful info to work on. You have done an impressive process and our entire neighborhood shall be thankful to you.

    cat blog2个月前 (05-08)回复
  7. #17

    I seriously love your site.. Excellent colors & theme. Did you make this amazing site yourself? Please reply back as I’m looking to create my own personal website and would like to learn where you got this from or what the theme is called. Thanks!

    Apex Legends Octane2个月前 (04-25)回复
  8. #16

    测试对 HTTP,SSH 协议都能实现完美转发。如果你使用类似
    AnyConnect 的方式去连接专有网络进行开发,这个事情可以相对容易的解决,但是会额外带来一个问题:你的所有流量都会走目标设备。而如果使用本地端口转发、系统PROXY的方案来做,有些客户端又支持的不是很好,比如我一直在使用的 Remotix ,我购买这款软件有好几年了,它能够让我在笔记本、平板、甚至是手机上解决一些问题,但是一旦我离开局域网环境,它的”假期就开始了”。然而,它工作起来更加糟糕,多年来一直没有缺失维护。将新端口转发规则添加到 vApp 网络之后,它将显示在 NAT 映射规则列表的底部。

  9. #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.

    Apex Legends2个月前 (04-20)回复
  10. #14

    Enjoyed the post.

    Puistjes2个月前 (04-19)回复
  11. #13

    Keep up the good work! Thanks.

    Huid verbetering2个月前 (04-18)回复
  12. #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.

    Magnesium drijven2个月前 (04-18)回复
  13. #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.

    Hyperpigmentatie2个月前 (04-17)回复
  14. #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.

    Huidverbetering2个月前 (04-17)回复
  15. #9

    Keep up the good work! Thanks.

    Huidverbetering2个月前 (04-17)回复
  16. #8

    Nice post! Thank you.

  17. #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.

    Zwangerschapsmasker2个月前 (04-16)回复
  18. #6

    Enjoyed the post.

    Zwangerschapsmasker2个月前 (04-16)回复
  19. #5

    Nice post! Thank you.

    Anti aging2个月前 (04-16)回复
  20. #4

    Keep up the good work! Thanks.

    Jeugdpuistjes2个月前 (04-16)回复
  21. #3

    Nice post! Thank you.

    schoonheidsspecialist2个月前 (04-15)回复
  22. #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?

    my singing monsters3个月前 (03-28)回复
  23. #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 Shamily4个月前 (03-11)回复

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

立即前往