Atom Editor 插件 atom-less 的使用方法
一、下载安装 atom-less
atom-less 项目在这里:https://github.com/schmuli/atom-less
安装方法请参考这篇博文:http://blog.csdn.net/kingittiger/article/details/51881442
二、使用方法
atom-less 的使用略显奇葩。跟其它 LESS 插件不同,它需要在每个 less 文件的头部都写上配置行,编译器读取这行配置,才可以正常运作。好处是,不同的 less 就可以用不同的配置,做到灵活输出,不用频繁去设置全局参数。
1. 官方参考说明 README.md
# atom-less package
An Atom package that auto-compiles LESS files on save, with support for LESS plugins, Clean-CSS and AutoPrefixer.
### Configuration
On the first line of LESS files, add a valid JSON comment, not including the outer brackets ('{' and '}'), with the following properties:
- **"main"**: `string` -
The relative or absolute path to the main LESS file to be compiled (ignores all other options)
- **"out"**: `boolean|string` -
`true` to output using the filename, or a string specifying a name to use
- **"compress"**: `boolean` -
Use Less.JS built-in compression (not compatible with Clean-CSS or Source Maps)
- **"strictMath"**: `boolean` -
Require brackets around math expressions
- **"sourceMap"**: `boolean|Object` -
`true` to turn on source maps, or an object specifying LESS source map properties
- **"cleancss"**: `string|object` -
a string specifying the 'compatibility' property,
or an object specifying the Clean-CSS properties (not compatible with Source Maps)
- **"autoprefixer"**: `string|object` -
a `;` separated string specifying the 'browsers' property,
or an object specifying the AutoPrefixer properties
Other LESS compiler options might work but are untested at this point.
### Road Map
1. Remove dependency on inline comments, and instead use a .lesscfg project file, allowing easier configuration and automatic support of additional LESS plugins
2. Change callback passing to use Promises
来源:https://atom.io/packages/atom-less
2. 常用选项配置
其实常用的选项就两个:out 和 compress。out 配置输出,compress 配置是否压缩。配置要写成 JSON 注释形式,但不包含花括号 { }。
配置形式:
// "<选项1>": "<配置1>", "<选项2>": "<配置2>", ...
下面举几个例子:
// "out": true ## 输出同名的 css 文件,不压缩
// "out": "test.css" ## 输出名为 test.css 文件,不压缩
// "out": true, "compress": true ## 输出名为 test.css 文件,压缩
3. 常见问题问答
valid less comment错误:https://github.com/schmuli/atom-less/issues/4
Atom Editor 插件 atom-less 的使用方法的更多相关文章
- Atom插件无法下载安装解决办法,Atom使用教程,Atom常用插件
使用教程http://wiki.jikexueyuan.com/project/atom/plug-in.html atom通过setting中无法下载插件,通过apm也无法下载插件,可能是网络.co ...
- atom常用插件安装
安装插件方法: File -Settings -Install 在搜索框里搜索你想要的插件,出来之后 点击install ,下图以 linter-selint 为例 ATOM常用插件推荐 simpli ...
- Atom 编辑器插件:amWiki 轻文库
amWiki 是一款基于 Javascript 脚本语言.依赖 Atom 编辑器.使用 Markdown 标记语法的轻量级开源 wiki 文库系统. amWiki 致力于让大家可以更简单.更便捷的建设 ...
- Facebook的ATOM Editor的底层Electron
Facebook的ATOM Editor的底层Electron 开源牛人 zcbenz 事情是这样的,微软推出了Visual Studio Code,我很好奇他怎么做跨平台的,所以就找找资料,在他的网 ...
- ATOM常用插件推荐
转载:http://blog.csdn.net/qq_30100043/article/details/53558381 ATOM常用插件推荐 simplified-chinese-menu ATOM ...
- Android x86模拟器Intel Atom x86 System Image配置与使用方法
Android x86模拟器Intel Atom x86 System Image配置与使用方法 前言: 大家现在开发使用的Android 模拟器模拟的是 ARM 的体系结构(ar ...
- Atom使用插件精选
小颖之前公司的大哥推荐小颖用的编辑器是atom,之前都是他给小颖了一个atom插件安装列表,小颖电脑出了点问题,所以后来小颖把那弄丢了,小颖重装atom后,就不知道要安装什么插件,所以也百度了很多,今 ...
- [转]Android x86模拟器Intel Atom x86 System Image配置与使用方法
Android x86模拟器Intel Atom x86 System Image配置与使用方法 前言: 大家现在开发使用的Android 模拟器模拟的是 ARM 的体系结构(arm-eabi),因此 ...
- 【编程工具】Sublime Text3 之 Emmet 插件的详细使用的方法
这篇关于 Emmet 插件使用的博文之前就想写了,今天刚好闲暇时间,就花了一些时间进行了总结. 我们都这道 Emmet 这款插件在前端设计里被称为神器,确实,神器称号名不虚传.因为这款插件可以帮助我们 ...
随机推荐
- 北京Uber优步司机奖励政策(12月12日)
用户组:人民优步及电动车(适用于12月12日) 滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:htt ...
- 天津Uber优步司机奖励政策(12月28日到12月29日)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
- Java:多线程中的volatile
一.为什么使用volatile 首先,通过一段简单的代码来理解为什么要使用volatile: public class RunThread extends Thread{ private boolea ...
- netty之心跳机制
1.心跳机制,在netty3和netty5上面都有.但是写法有些不一样. 2.心跳机制在服务端和客户端的作用也是不一样的.对于服务端来说:就是定时清除那些因为某种原因在一定时间段内没有做指定操作的客户 ...
- element-ui 分页注意事项
<template> <div id="monitor"> 一页显示 {{currentCount}}条 当前第 {{currentPage}}页 < ...
- 「日常训练」 Genghis Khan the Conqueror(HDU-4126)
题意 给定\(n\)个点和\(m\)条无向边(\(n\le 3000\)),需要将这\(n\)个点连通.但是有\(Q\)次(\(Q\le 10^4\))等概率的破坏,每次破坏会把\(m\)条边中的某条 ...
- Qt 5 最新信号和槽连接方式以及Lambda表达式
最近学习Qt,发现新大陆,这里做下记录. 主要内容就是原始Qt4的信号槽连接方式,以及Qt5新版的连接方式,还有件事简单演示一下lambda表达式的使用方式 代码如下 /* * 作者:张建伟 * 时间 ...
- 苏醒的巨人----CSRF
一.CSRF 跨站请求伪造(Cross-Site Request Forgery,CSRF)是指利用 受害者尚未失效的身份认证信息(cookie.会话等),诱骗其点 击恶意链接或者访问包含攻击代码的页 ...
- python一标准异常总结大全(非常全)
Python标准异常总结 AssertionError 断言语句(assert)失败 AttributeError 尝试访问未知的对象属性 EOFError 用户输入文件末尾标志EOF(Ctrl+d) ...
- angular-使用定时器调后台接口
今天写了一个功能,一个是在两个页面中每隔一秒就调用一个后台接口 首先,这个功能使用了JS里的定时器.JS计时器分为一次性计时器和间隔性触发计时器,此次每隔一秒要调用这个接口,使用的是间隔性触发计时器 ...