
less模块
YUHUI01
总有刁民想害朕
展开
-
less模块——混合(像函数一样可以调用)
123原创 2018-07-06 18:44:56 · 1846 阅读 · 0 评论 -
less模块——嵌套
我们可以在一个选择器中嵌套另一个选择器来实现继承(&相当于this)body{ //less font-size: 20px; h1{ font-size: 23px; p{ a{ text-decoration: none; ...原创 2018-07-06 18:53:36 · 545 阅读 · 0 评论 -
less模块——函数 & 运算
可以利用加减乘除计算属性值以及颜色运算可以忽略单位(单位相同情况下)如:18px+13 #888+#123456@the_color:#111; //less@base_border:1px;@color:#888;#test{ color: @the_color *5; border-right: @base_border+16; ...原创 2018-07-06 19:57:23 · 1265 阅读 · 0 评论 -
less模块——arguments变量
arguments表示传进来的所有参数.box-shadow (@x: 0, @y: 0, @blur: 1px, @color: #000) { //less box-shadow: @arguments; -moz-box-shadow: @arguments; -webkit-box-shadow: @arguments; }.div{ .box-sh...原创 2018-07-06 23:06:50 · 803 阅读 · 0 评论 -
less模块——匹配模式
相当于对函数的重写,根据参数匹配对应的混合.test(light,@color){ //less color: lighten(@color,10%);};.test(dark,@color){ color: darken(@color,10%);};.test(@_,@color){ display: block;};@switch...原创 2018-07-06 23:24:51 · 1387 阅读 · 1 评论 -
less模块——布尔值
在less模块中,只有true代表真值,其它的所有值都表示假.test(@a)when(@a){ //less color: red;}.test(@a)when(@a=true){ color: black;}div{ .test(123)}span{ .test(true)}span { ...原创 2018-07-06 23:52:44 · 504 阅读 · 0 评论 -
less模块——检测函式
ispixel——是否为像素ispercentage——是否为百分比isem——是否为emiscolor——是否为颜色isnumber——是否为数字isstring——是否为字符串iskeyword——是否为keywordisurl——是否为url...原创 2018-07-07 00:15:22 · 352 阅读 · 0 评论 -
less模块——color函数
lighten(@color,10%) //返回颜色比@color浅10%的颜色darken(@color,10%) //...深saturate(@color,10%) //...饱和比 深desaturate(@color,10%) //...饱和比 浅fadein(@color,10%) //...不透明10...原创 2018-07-07 00:44:06 · 3908 阅读 · 0 评论 -
less模块——math函数
round(2.86) //四舍五入 返回 3ceil(2.3) //向上取整 返回 3floor(2.6) //向下取整 返回 2);percentage(0.6) //转为百分比 返回60%原创 2018-07-07 00:53:10 · 1383 阅读 · 0 评论