diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/css_functions | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/css/css_functions')
-rw-r--r-- | files/zh-cn/web/css/css_functions/index.html | 257 |
1 files changed, 257 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/css_functions/index.html b/files/zh-cn/web/css/css_functions/index.html new file mode 100644 index 0000000000..f5f1b38000 --- /dev/null +++ b/files/zh-cn/web/css/css_functions/index.html @@ -0,0 +1,257 @@ +--- +title: CSS Functional Notation +slug: Web/CSS/CSS_Functions +tags: + - CSS Function + - CSS 函数 + - attr() + - calc() + - minmax() + - var() +translation_of: Web/CSS/CSS_Functions +--- +<div>{{CSSRef}}</div> + +<p><strong>CSS 功能符号</strong>是一种 <a href="/en-US/docs/Web/CSS/CSS_Values_and_Units">CSS 值</a>,可以表示更复杂的数据类型或调用特殊的数据处理或计算。</p> + +<h2 id="句法">句法</h2> + +<pre class="syntaxbox notranslate">selector { + property: functional-notation( [argument]? [, argument]! ); +}</pre> + +<p>The syntax starts with the <strong>name of the functional notation</strong>, followed by a left parenthesis <code>(</code>. Next up are the notation argument(s), and the function is finished off with a closing parenthesis <code>)</code>.</p> + +<p>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.</p> + +<h2 id="索引">索引</h2> + +<p>Functional notation defined by a set of CSS specifications includes the following:</p> + +<div class="index"><span>A</span> + +<ul> + <li>{{CSSxRef("abs", "abs()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("acos", "acos()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("font-variant-alternates/annotation()", "annotation()")}} (font)</li> + <li>{{CSSxRef("asin", "asin()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("atan", "atan()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("atan2", "atan2()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("attr")}}</li> +</ul> +<span>B</span> + +<ul> + <li>{{CSSxRef("filter-function/blur", "blur()")}} (filter)</li> + <li>{{CSSxRef("filter-function/brightness", "brightness()")}} (filter)</li> +</ul> +<span>C</span> + +<ul> + <li>{{CSSxRef("calc")}} (math)</li> + <li>{{CSSxRef("font-variant-alternates/character-variant()", "character-variant()")}} (font)</li> + <li>{{CSSxRef("circle", "circle()")}} (shape)</li> + <li>{{CSSxRef("clamp")}} (math)</li> + <li>{{CSSxRef("color()")}} (colors) {{Experimental_Inline}}</li> + <li>{{CSSxRef("conic-gradient")}}</li> + <li>{{CSSxRef("cos", "cos()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("counter")}}</li> + <li>{{CSSxRef("counters")}}</li> + <li>{{CSSxRef("filter-function/contrast", "contrast()")}} (filter)</li> + <li>{{CSSxRef("cross-fade")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("cubic-bezier", "cubic-bezier()")}}</li> +</ul> +<span>D</span> + +<ul> + <li>{{CSSxRef("device-cmyk", "device-cmyk()")}} (colors) {{Experimental_Inline}}</li> + <li>{{CSSxRef("filter-function/drop-shadow", "drop-shadow()")}} (filter)</li> +</ul> +<span>E</span> + +<ul> + <li>{{CSSxRef("element")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("env")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("ellipse", "ellipse()")}} (shape)</li> + <li>{{CSSxRef("exp", "exp()")}} (math) {{Experimental_Inline}}</li> +</ul> +<span>F</span> + +<ul> + <li>{{CSSxRef("fit-content", "fit-content()")}}</li> + <li>{{CSSxRef("format", "format()")}}</li> +</ul> +<span>G</span> + +<ul> + <li>{{CSSxRef("filter-function/grayscale", "grayscale()")}} (filter)</li> +</ul> +<span>H</span> + +<ul> + <li>{{CSSxRef("hsl", "hsl()")}} (colors)</li> + <li>{{CSSxRef("hsla", "hsla()")}} (colors)</li> + <li>{{CSSxRef("filter-function/hue-rotate", "hue-rotate()")}} (filter)</li> + <li>{{CSSxRef("hwb", "hwb()")}} (colors) {{Experimental_Inline}}</li> + <li>{{CSSxRef("hypot", "hypot()")}} (math) {{Experimental_Inline}}</li> +</ul> +<span>I</span> + +<ul> + <li>{{CSSxRef("imagefunction", "image()")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("image-set")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("inset()")}} (shape)</li> + <li>{{CSSxRef("filter-function/invert", "invert()")}} (filter)</li> +</ul> +<span>L</span> + +<ul> + <li>{{CSSxRef("lab", "lab()")}} (colors) {{Experimental_Inline}}</li> + <li>{{CSSxRef("lch", "lch()")}} (colors) {{Experimental_Inline}}</li> + <li>{{CSSxRef("leader", "leader()")}}</li> + <li>{{CSSxRef("linear-gradient")}}</li> + <li>{{CSSxRef("local", "local()")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("log", "log()")}} (math) {{Experimental_Inline}}</li> +</ul> +<span>M</span> + +<ul> + <li>{{CSSxRef("transform-function/matrix", "matrix()")}} (transform)</li> + <li>{{CSSxRef("transform-function/matrix3d", "matrix3d()")}} (transform)</li> + <li>{{CSSxRef("max")}} (math)</li> + <li>{{CSSxRef("min")}} (math)</li> + <li>{{CSSxRef("minmax")}} (math)</li> + <li>{{CSSxRef("mod", "mod()")}} (math) {{Experimental_Inline}}</li> +</ul> +<span>O</span> + +<ul> + <li>{{CSSxRef("filter-function/opacity", "opacity()")}} (filter)</li> + <li>{{CSSxRef("font-variant-alternates/ornaments()", "ornaments()")}} (font)</li> +</ul> +<span>P</span> + +<ul> + <li>{{CSSxRef("paint")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("path", "path()")}} (shape)</li> + <li>{{CSSxRef("transform-function/perspective", "perspective()")}} (transform)</li> + <li>{{CSSxRef("polygon", "polygon()")}} (shape)</li> + <li>{{CSSxRef("pow", "pow()")}} (math) {{Experimental_Inline}}</li> +</ul> +<span>R</span> + +<ul> + <li>{{CSSxRef("radial-gradient")}}</li> + <li>{{CSSxRef("rem", "rem()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("repeat")}}</li> + <li>{{CSSxRef("repeating-linear-gradient")}}</li> + <li>{{CSSxRef("repeating-radial-gradient")}}</li> + <li>{{CSSxRef("repeating-conic-gradient")}}</li> + <li>rgb() (colors)</li> + <li>rgba() (colors)</li> + <li>{{CSSxRef("transform-function/rotate", "rotate()")}} (transform)</li> + <li>{{CSSxRef("transform-function/rotate3d", "rotate3d()")}} (transform)</li> + <li>{{CSSxRef("transform-function/rotateX", "rotateX()")}} (transform)</li> + <li>{{CSSxRef("transform-function/rotateY", "rotateY()")}} (transform)</li> + <li>{{CSSxRef("transform-function/rotateZ", "rotateZ()")}} (transform)</li> + <li>{{CSSxRef("round", "round()")}} (math) {{Experimental_Inline}}</li> +</ul> +<span>S</span> + +<ul> + <li>{{CSSxRef("filter-function/saturate", "saturate()")}} (filter)</li> + <li>{{CSSxRef("transform-function/scale", "scale()")}} (transform)</li> + <li>{{CSSxRef("transform-function/scale3d", "scale3d()")}} (transform)</li> + <li>{{CSSxRef("transform-function/scaleX", "scaleX()")}} (transform)</li> + <li>{{CSSxRef("transform-function/scaleY", "scaleY()")}} (transform)</li> + <li>{{CSSxRef("transform-function/scaleZ", "scaleZ()")}} (transform)</li> + <li>{{CSSxRef("filter-function/sepia", "sepia()")}} (filter)</li> + <li>{{CSSxRef("sign", "sign()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("sin", "sin()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("transform-function/skew", "skew()")}} (transform)</li> + <li>{{CSSxRef("transform-function/skewX", "skewX()")}} (transform)</li> + <li>{{CSSxRef("transform-function/skewY", "skewY()")}} (transform)</li> + <li>{{CSSxRef("sqrt", "sqrt()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("steps", "steps()")}}</li> + <li>{{CSSxRef("font-variant-alternates/styleset()", "styleset()")}} (font)</li> + <li>{{CSSxRef("font-variant-alternates/stylistic()", "stylistic()")}} (font)</li> + <li>{{CSSxRef("font-variant-alternates/swash()", "swash()")}} (font)</li> + <li>{{CSSxRef("symbols", "symbols()")}}</li> +</ul> +<span>T</span> + +<ul> + <li>{{CSSxRef("tan", "tan()")}} (math) {{Experimental_Inline}}</li> + <li>{{CSSxRef("target-counter", "target-counter()")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("target-counters", "target-counters()")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("target-text", "target-text()")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("toggle", "toggle()")}} {{Experimental_Inline}}</li> + <li>{{CSSxRef("transform-function/translate", "translate()")}} (transform)</li> + <li>{{CSSxRef("transform-function/translate3d", "translate3d()")}} (transform)</li> + <li>{{CSSxRef("transform-function/translateX", "translateX()")}} (transform)</li> + <li>{{CSSxRef("transform-function/translateY", "translateY()")}} (transform)</li> + <li>{{CSSxRef("transform-function/translateZ", "translateZ()")}} (transform)</li> +</ul> +<span>U</span> + +<ul> + <li>{{CSSxRef("url()", "url()")}}</li> +</ul> +<span>V</span> + +<ul> + <li>{{CSSxRef("var")}}</li> +</ul> +</div> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("CSS4 Values")}}</td> + <td>{{Spec2("CSS4 Values")}}</td> + <td>Adds <code>toggle()</code>, <code>attr()</code>, <code>calc()</code>, <code>min()</code>, <code>max()</code>, <code>clamp()</code>, <code>round()</code>, <code>mod()</code>, <code>rem()</code>, <code>mod()</code>, <code>sin()</code>, <code>cos()</code>, <code>tan()</code>, <code>asin()</code>, <code>acos()</code>, <code>atan()</code>, <code>atan2()</code>, <code>pow()</code>, <code>sqrt()</code>, <code>hypot()</code>, <code>log()</code>, <code>exp()</code>, <code>abs()</code> and <code>sign()</code> functional notation.</td> + </tr> + <tr> + <td>{{SpecName("CSS3 Values")}}</td> + <td>{{Spec2("CSS3 Values")}}</td> + <td>Adds <code>calc()</code> functional notation.</td> + </tr> + <tr> + <td>{{SpecName("CSS4 Colors")}}</td> + <td>{{Spec2("CSS4 Colors")}}</td> + <td>Adds commaless syntaxes for the <code>rgb()</code>, <code>rgba()</code>, <code>hsl()</code>, and <code>hsla()</code> functional notation.<br> + Allows alpha values in <code>rgb()</code> and <code>hsl()</code>, turning <code>rgba()</code> and <code>hsla()</code> into (deprecated) aliases for them.<br> + Adds <code>hwb()</code>, <code>device-cmyk()</code>, and <code>color()</code> functions.</td> + </tr> + <tr> + <td>{{SpecName("CSS3 Colors")}}</td> + <td>{{Spec2("CSS3 Colors")}}</td> + <td>Adds <code>rgba()</code>, <code>hsl()</code>, <code>hsla()</code> functional notation.</td> + </tr> + <tr> + <td>{{SpecName("CSS4 Images")}}</td> + <td>{{Spec2("CSS4 Images")}}</td> + <td>Adds <code>element()</code>, <code>image()</code>, <code>image-set()</code> and <code>conic-gradient()</code> functional notation.</td> + </tr> + </tbody> +</table> + +<h2 id="也可以看看">也可以看看</h2> + +<ul> + <li><a href="/en-US/docs/Web/CSS/CSS_Values_and_Units">CSS Values and Units</a></li> + <li><a href="/en-US/docs/Learn/CSS/Introduction_to_CSS/Values_and_units">Introduction to CSS: Values and Units </a></li> +</ul> + +<div id="gtx-trans" style="position: absolute; left: 166px; top: 4490px;"> +<div class="gtx-trans-icon"></div> +</div> |