快速入门
概览
变量(Variables)
混入(Mixins)
嵌套(Nesting)
运算(Operations)
转义(Escaping)
函数(Functions)
命名空间和访问符
映射(Maps)
作用域(Scope)
注释(Comments)
导入(Importing)
使用 Less.js
命令行用法
浏览器使用
Less.js选项
预加载插件
程序化使用
API
为 Less.js 做贡献
Less 函数手册
逻辑函数
字符串函数
列表函数
数学函数
类型函数
杂项函数
颜色定义函数
颜色通道函数
颜色操作函数
颜色混合函数
进阶指南
变量
父选择器
继承
合并
Mixins
CSS Guards
分离规则集
@import At-Rules
@plugin At-Rules
Maps (NEW!)
作用域
映射(Maps) - Less入门文档 - 笔下光年
网站首页
映射(Maps)
从 Less 3.5 版本开始,你还可以将混入(mixins)和规则集(rulesets)作为一组值的映射(map)使用。 ```less #colors() { primary: blue; secondary: green; } .button { color: #colors[primary]; border: 1px solid #colors[secondary]; } ``` 输出符合预期: ```css .button { color: blue; border: 1px solid green; } ``` 参见: [映射(Maps)](http://www.bixiaguangnian.com/manual/less/1134.html "映射(Maps)")
上一篇:
命名空间和访问符
下一篇:
作用域(Scope)