Skip to content

Commit e9b96b7

Browse files
committed
Rephrased stripes() and added it to <image>
1 parent 72ff857 commit e9b96b7

File tree

1 file changed

+36
-47
lines changed

1 file changed

+36
-47
lines changed

css-images-4/Overview.bs

+36-47
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Value Definitions {#values}
7272
or <a section href="#gradients">gradient notation</a>.
7373
Its syntax is:
7474

75-
<pre class="prod"><dfn>&lt;image></dfn> = <<url>> | <<image()>> | <<image-set()>> | <<cross-fade()>> | <<element()>> | <<gradient>></pre>
75+
<pre class="prod"><dfn>&lt;image></dfn> = <<url>> | <<image()>> | <<image-set()>> | <<cross-fade()>> | <<element()>> | <<gradient>> | <<stripes()>></pre>
7676

7777
An <<image>> can be used in many CSS properties,
7878
including the 'background-image', 'list-style-image', 'cursor' properties [[!CSS2]]
@@ -1116,47 +1116,6 @@ Cycle Detection</h4>
11161116
If the graph contains a cycle,
11171117
any ''element()'' functions participating in the cycle are <a>invalid images</a>.
11181118

1119-
1120-
<!--
1121-
██████ ████████ ████████ ████ ████████ ███████ ██████ ███ ███
1122-
██ ██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██
1123-
██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██
1124-
██████ ██ ████████ ██ ████████ █████ ██████ ██ ██
1125-
██ ██ ██ ██ ██ ██ █ ██ ██ ██
1126-
██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██
1127-
██████ ██ ██ ██ ████ ██ ███████ ██████ ███ ███
1128-
-->
1129-
1130-
Stripes: the ''stripes()'' notation {#stripes-function}
1131-
----------------------------------------------------------------------
1132-
1133-
The ''stripes()'' function allows to define a number of stripes of
1134-
different colors with different widths. How those stripes are actually
1135-
painted depends on the context the function is used in.
1136-
1137-
The syntax for ''stripes()'' is defined as:
1138-
1139-
<pre class=prod>
1140-
<dfn>stripes()</dfn> = stripes( [ <<color>> && [ <<length-percentage>> | <<flex>>]? ]# )
1141-
</pre>
1142-
1143-
The function represents a 1-dimensional image generated by a list
1144-
of colors and an optional thickness for each of them.
1145-
1146-
A <<percentage>> or <<flex>> value refers to the total length of the image
1147-
in the used context.
1148-
The <<percentage>> must be between ''0%'' and ''100%'' inclusive;
1149-
any other value is invalid.
1150-
1151-
If the thickness of a stripe is omitted, it is meant to be ''1fr''.
1152-
1153-
If the width of the context the function is used in exceeds the total
1154-
thickness of the stripes, the rest is painted transparent. I.e. it behaves
1155-
as if there were an additional last ''transparent'' stripe.
1156-
If the width of the context the function is used in is smaller than the
1157-
total thickness of the stripes, the stripes are clipped starting from the
1158-
last defined color.
1159-
11601119
<!--
11611120
██████ ████████ ███ ████████ ████ ████████ ██ ██ ████████ ██████
11621121
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██
@@ -1935,15 +1894,45 @@ Color Stop “Fixup”</h4>
19351894
</pre>
19361895
</div>
19371896

1938-
1939-
1897+
<!--
1898+
██████ ████████ ████████ ████ ████████ ███████ ██████ ███ ███
1899+
██ ██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██
1900+
██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██
1901+
██████ ██ ████████ ██ ████████ █████ ██████ ██ ██
1902+
██ ██ ██ ██ ██ ██ █ ██ ██ ██
1903+
██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██
1904+
██████ ██ ██ ██ ████ ██ ███████ ██████ ███ ███
1905+
-->
19401906

19411907
1D Image Values: the ''stripes()'' notation {#stripes}
19421908
======================================================
19431909

1944-
Issue: <a href="https://github.com/w3c/csswg-drafts/issues/2532">Per WG resolution</a>,
1945-
define the ''stripes()'' function
1946-
which creates a 1D image for use in borders/outlines.
1910+
The ''stripes()'' function allows to define a number of stripes of
1911+
different colors with different widths.
1912+
1913+
The syntax for ''stripes()'' is defined as:
1914+
1915+
<pre class=prod>
1916+
<dfn>stripes()</dfn> = stripes( [ <<color>> && [ <<length-percentage>> | <<flex>>]? ]# )
1917+
</pre>
1918+
1919+
The function represents a 1-dimensional image generated by a list of colors
1920+
and an optional thickness for each of them.
1921+
1922+
A <<percentage>> or <<flex>> value refers to the total length of the image
1923+
in the used context.
1924+
The <<percentage>> must be between ''0%'' and ''100%'' inclusive;
1925+
any other value is invalid.
1926+
1927+
If the thickness of a stripe is omitted, it is interpreted as ''1fr''.
1928+
1929+
If not defined differently by the context the function is used in, the
1930+
stripes are painted from top to bottom and tiled horizontally. If the size
1931+
of the painting area exceeds the total thickness of the stripes, the
1932+
remaining area is painted transparently. I.e. it behaves as if there was an
1933+
additional last ''transparent'' stripe. If the size of the painting area
1934+
is smaller than the total thickness of the stripes, the stripes are clipped
1935+
starting from the last defined color.
19471936

19481937
<!--
19491938
██████ ████ ████████ ████ ██ ██ ██████

0 commit comments

Comments
 (0)