CSS 函数表示法 is a type of CSS 值 that can represent more complex data types or invoke special data processing or calculations.
selector {
property: functional-notation( [argument]? [, argument]! );
}
The syntax starts with the
name of the functional notation
, followed by a left parenthesis
(
. Next up are the notation argument(s), and the function is finished off with a closing parenthesis
)
.
Functions can take multiple arguments, which are formatted similarly to CSS property values. Whitespace is allowed, but they are optional inside the parentheses. In some functional notations multiple arguments are separated by commas, while others use spaces.
Functional notation defined by a set of CSS specifications includes the following:
blur()
(filter)
brightness()
(filter)
calc
(数学)
character-variant()
(字体)
circle()
(形状)
clamp()
(数学)
color()
(颜色)
conic-gradient()
cos()
(数学)
counter()
counters()
contrast()
(filter)
cross-fade()
cubic-bezier()
device-cmyk()
(颜色)
drop-shadow()
(filter)
grayscale()
(filter)
hsl()
(颜色)
hsla()
(颜色)
hue-rotate()
(filter)
hwb()
(颜色)
hypot()
(数学)
image()
image-set()
inset()
(形状)
invert()
(filter)
opacity()
(filter)
ornaments()
(字体)
paint()
path()
(形状)
perspective()
(变换)
polygon()
(形状)
pow()
(数学)
radial-gradient()
rem()
(数学)
repeat()
repeating-linear-gradient()
repeating-radial-gradient()
repeating-conic-gradient()
rotate()
(变换)
rotate3d()
(变换)
rotatex()
(变换)
rotatey()
(变换)
rotatez()
(变换)
round()
(数学)
saturate()
(filter)
scale()
(变换)
scale3d()
(变换)
scalex()
(变换)
scaley()
(变换)
scalez()
(变换)
sepia()
(filter)
sign()
(数学)
sin()
(数学)
skew()
(变换)
skewx()
(变换)
skewy()
(变换)
sqrt()
(数学)
steps()
styleset()
(字体)
stylistic()
(字体)
swash()
(字体)
symbols()
tan()
(数学)
target-counter()
target-counters()
target-text()
toggle()
translate()
(变换)
translate3d()
(变换)
translatex()
(变换)
translatey()
(变换)
translatez()
(变换)
| 规范 | 状态 | 注释 |
|---|---|---|
| CSS Values and Units Module Level 4 | 编者草案 |
添加
toggle()
,
attr()
,
calc()
,
min()
,
max()
,
clamp()
,
round()
,
mod()
,
rem()
,
mod()
,
sin()
,
cos()
,
tan()
,
asin()
,
acos()
,
atan()
,
atan2()
,
pow()
,
sqrt()
,
hypot()
,
log()
,
exp()
,
abs()
and
sign()
functional notation.
|
| CSS Values and Units Module Level 3 | 候选推荐 |
添加
calc()
functional notation.
|
| CSS Color Module Level 4 | 工作草案 |
Adds commaless syntaxes for the
rgb()
,
rgba()
,
hsl()
,和
hsla()
functional notation.
Allows alpha values in
rgb()
and
hsl()
, turning
rgba()
and
hsla()
into (deprecated) aliases for them.
添加
hwb()
,
device-cmyk()
,和
color()
函数。
|
| CSS Color Module Level 3 | 推荐 |
添加
rgba()
,
hsl()
,
hsla()
functional notation.
|
| CSS Images Module Level 4 | 工作草案 |
添加
element()
,
image()
,
image-set()
and
conic-gradient()
functional notation.
|