Sass 支持多种值类型,其中大部分直接来自 CSS。每个 表达 产生一个值,变量 保存值。大多数值类型直接来自 CSS

  • 数字,可能有单位,也可能没有单位,如 12100px

    ¥Numbers, which may or may not have units, like 12 or 100px.

  • 字符串,可能有引号,也可能没有,如 "Helvetica Neue"bold

    ¥Strings, which may or may not have quotes, like "Helvetica Neue" or bold.

  • 颜色,可以通过其十六进制表示形式或名称来引用,例如 #c6538cblue,或者从函数返回,例如 rgb(107, 113, 127)hsl(210, 100%, 20%)

    ¥Colors, which can be referred to by their hex representation or by name, like #c6538c or blue, or returned from functions, like rgb(107, 113, 127) or hsl(210, 100%, 20%).

  • 值列表,可以用空格或逗号分隔,并且可以用方括号括起来或根本不加括号,例如 1.5em 1em 0 2emHelvetica, Arial, sans-serif[col1-start]

    ¥Lists of values, which may be separated by spaces or commas and which may be enclosed in square brackets or no brackets at all, like 1.5em 1em 0 2em, Helvetica, Arial, sans-serif, or [col1-start].

还有一些特定于 Sass 的:

¥A few more are specific to Sass: