一、下载安装 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 和 compressout 配置输出,compress 配置是否压缩。配置要写成 JSON 注释形式,但不包含花括号 { }

配置形式:

// "<选项1>": "<配置1>", "<选项2>": "<配置2>", ...

下面举几个例子:

// "out": true                  ## 输出同名的 css 文件,不压缩
// "out": "test.css" ## 输出名为 test.css 文件,不压缩
// "out": true, "compress": true ## 输出名为 test.css 文件,压缩

3. 常见问题问答

Atom Editor 插件 atom-less 的使用方法的更多相关文章

  1. Atom插件无法下载安装解决办法,Atom使用教程,Atom常用插件

    使用教程http://wiki.jikexueyuan.com/project/atom/plug-in.html atom通过setting中无法下载插件,通过apm也无法下载插件,可能是网络.co ...

  2. atom常用插件安装

    安装插件方法: File -Settings -Install 在搜索框里搜索你想要的插件,出来之后 点击install ,下图以 linter-selint 为例 ATOM常用插件推荐 simpli ...

  3. Atom 编辑器插件:amWiki 轻文库

    amWiki 是一款基于 Javascript 脚本语言.依赖 Atom 编辑器.使用 Markdown 标记语法的轻量级开源 wiki 文库系统. amWiki 致力于让大家可以更简单.更便捷的建设 ...

  4. Facebook的ATOM Editor的底层Electron

    Facebook的ATOM Editor的底层Electron 开源牛人 zcbenz 事情是这样的,微软推出了Visual Studio Code,我很好奇他怎么做跨平台的,所以就找找资料,在他的网 ...

  5. ATOM常用插件推荐

    转载:http://blog.csdn.net/qq_30100043/article/details/53558381 ATOM常用插件推荐 simplified-chinese-menu ATOM ...

  6. Android x86模拟器Intel Atom x86 System Image配置与使用方法

    Android x86模拟器Intel Atom x86 System Image配置与使用方法      前言:      大家现在开发使用的Android 模拟器模拟的是 ARM 的体系结构(ar ...

  7. Atom使用插件精选

    小颖之前公司的大哥推荐小颖用的编辑器是atom,之前都是他给小颖了一个atom插件安装列表,小颖电脑出了点问题,所以后来小颖把那弄丢了,小颖重装atom后,就不知道要安装什么插件,所以也百度了很多,今 ...

  8. [转]Android x86模拟器Intel Atom x86 System Image配置与使用方法

    Android x86模拟器Intel Atom x86 System Image配置与使用方法 前言: 大家现在开发使用的Android 模拟器模拟的是 ARM 的体系结构(arm-eabi),因此 ...

  9. 【编程工具】Sublime Text3 之 Emmet 插件的详细使用的方法

    这篇关于 Emmet 插件使用的博文之前就想写了,今天刚好闲暇时间,就花了一些时间进行了总结. 我们都这道 Emmet 这款插件在前端设计里被称为神器,确实,神器称号名不虚传.因为这款插件可以帮助我们 ...

随机推荐

  1. VINS(八)初始化

    首先通过imu预积分陀螺仪和视觉特征匹配分解Fundamental矩阵获取rotationMatrix之间的约束关系,联立方程组可以求得外参旋转矩阵: 接下来会检测当前frame_count是否达到W ...

  2. springBoot RabbitMq 转换json序列化

    package com.alirm.redis_cache.config.RabbitMQ; import org.springframework.amqp.rabbit.core.RabbitTem ...

  3. ping telnet 指令

    Ping 一 作用 ping能够辨别网络功能的某些状态,这些状态是日常网络故障诊断的基础.Ping能够识别连接的二进制状态(看是否连通).Ping命令通过过向计算机发送ICMP回应报文并监听回应报文的 ...

  4. Arduino-元件简介

    DS18B20温度传感器 DS18B20是DALLAS公司生产的一种常用的温度传感器,其具有体积小巧.硬件功耗低.抗干扰能力强.精准度高的特点.该传感器具有单总线通讯的能力,电压范围为3.0V~5.5 ...

  5. C#原型模式

    如下: [Serializable] public class ModelNewTable : ICloneable { public object Clone() { using (var stre ...

  6. HTML 常见的 DOCTYPE 声明

    <!DOCTYPE> 声明必须是 HTML 文档的第一行,位于 <html> 标签之前. <!DOCTYPE> 声明不是 HTML 标签:它是指示 web 浏览器关 ...

  7. python 定位文件目录

    经常有引用文件的地方,所以整理了一下如何定位文件目录的方法 定位当前文件的目录 import os file_path = os.path.dirname(__file__) 定位当前文件的父目录 i ...

  8. Web自动化测试环境搭建1(基于firefox火狐浏览器)

    自动化测试是时代趋势,因此很多测试人员开始研究自动化测试,web自动化测试化测试并不难,但是很多人都是被挡在了环境搭建这一步,后面学习激情全无,这里,韬哥手把手教大家搭建火狐浏览器下的自动化测试环境( ...

  9. 安装mysql-5.7.12-winx64

    之前安装mysql时未做总结,换新电脑,补上安装记录,安装的时候,找了些网友的安装记录,发现好多坑 1.mysql-5.7.12-winx64.zip下载 官方下载地址:http://dev.mysq ...

  10. Django常用命令总结

    安装Django: pip install django 指定版本  pip3 install django==2.0 新建项目: django-admin.py startprject mysite ...