LESS Guide

This artilce is not write by myself,most of them is copy from the offcial document.If you want to learn more .

plz click : http://lesscss.org/features/#features-overview-feature.

I want to recommand a dictionary for you guys.It is English-English dictionary ,and this dictionary will help you understand the 

word more clear and precisely 。

plz click: https://www.ldoceonline.com/dictionary/

 

overview

Less (which stands for Leaner Style Sheets) is a backwards-compatible language extension for CSS. 

 

Variables

.link{
    color: #eeeeee;
}
.widget{
    color: #eeeeee;
    background: #f3f3f3;
}

//  converts your Less styles to CSS styles.
//outputs

@link-color:#eeeeee;
@link-color-hover: darken(@link-color: 10%);
.link{
    color: @link-color;
}

variable make your code easier to maintain by giving you a way to control those values from a single location.

@link-color:#eeeeee;
@link-color-hover: darken(@link-color: 10%);
.link{
    color: @link-color;
}

a:hover{
    color: @link-color-hover;
}

Variable Interpolation

Selectors  v1.4.0

// Variables
@my-selector: banner;

// usage
.@{my-selector} {
  font-weight: bold;
  line-height: 40px;
  margin: 0 auto;
}

Compiles to :

.banner {
  font-weight: bold;
  line-height: 40px;
  margin: 0 auto;
}

 

URLS

// Varaiable
@images : "../img";

// Usage
body{
    background-color: url("@{images}/white-sand.png")
}

Import Statements v1.4.0

//Variable
@themes: "../../src/themes"

//Usage
@import "@{themes}/tidal-wave.less"

Properties

 

 

附:LESS 英文文档生词

backwards-compatible 向下兼容

learning it is a breeze 轻而易举的事

 Built-in (forming a part of something that cannot be separated from it ->inbuilt) 嵌入

 third-party  第三方

self-explanatory 自解释

Variable Variables 可变变量

referencing variables 引用变量

environment variable 环境变量

nested rule 嵌套规则

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值