码迷,mamicode.com
首页 > 其他好文 > 详细

Sass函数:Introspection 函数 -type-of()

时间:2018-05-31 00:23:27      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:返回   字符串   ber   div   返回值   一个   cti   s函数   lse   

type-of() 函数主要用来判断一个值是属于什么类型:

返回值:

  • number 为数值型。
  • string 为字符串型。
  • bool 为布尔型。
  • color 为颜色型。
>> type-of(100)
"number"
>> type-of(100px)
"number"
>> type-of("asdf")
"string"
>> type-of(asdf)
"string"
>> type-of(true)
"bool"
>> type-of(false)
"bool"
>> type-of(#fff)
"color"
>> type-of(blue)
"color"
>> type-of(1 / 2 = 1)
"string"

 

Sass函数:Introspection 函数 -type-of()

标签:返回   字符串   ber   div   返回值   一个   cti   s函数   lse   

原文地址:https://www.cnblogs.com/qjuly/p/9114014.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!