Skip to content

Commit 3e7df1c

Browse files
committed
[css-color-4] Modern hsl & hsla also allows mixed num-pct w3c#8231
1 parent 8a7728f commit 3e7df1c

1 file changed

Lines changed: 18 additions & 14 deletions

File tree

css-color-4/Overview.bs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,15 +1964,28 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2>
19641964

19651965
There are several other color schemes possible.
19661966
One such is the HSL [[!HSL]] color scheme,
1967-
which is much more intuitive to use,
1967+
which is more intuitive to use,
19681968
but still maps easily back to RGB colors.
19691969

19701970
<dfn value export for="hsl()">HSL</dfn> colors are specified
19711971
as a triplet of hue, saturation, and lightness.
1972-
The syntax of the ''hsl()'' function is:
1972+
The syntax of the ''hsl()'' and ''hsla()'' functions is:
19731973

19741974
<pre class='prod'>
1975-
<dfn>hsl()</dfn> = hsl( [<<hue>> | none] [<<percentage>> | none] [<<percentage>> | none] [ / [<<alpha-value>> | none] ]? )
1975+
<dfn>hsl()</dfn> = [ <<legacy-hsl-syntax>> | <<modern-hsl-syntax>> ]
1976+
<dfn>hsla()</dfn> = [ <<legacy-hsla-syntax>> | <<modern-hsla-syntax>> ]
1977+
<dfn><<modern-hsl-syntax>></dfn> = hsl(
1978+
[<<hue>> | none]
1979+
[<<percentage>> | <<number>> | none]
1980+
[<<percentage>> | <<number>> | none]
1981+
[ / [<<alpha-value>> | none] ]? )
1982+
<dfn><<modern-hsla-syntax>></dfn> = hsla(
1983+
[<<hue>> | none]
1984+
[<<percentage>> | <<number>> | none]
1985+
[<<percentage>> | <<number>> | none]
1986+
[ / [<<alpha-value>> | none] ]? )
1987+
<dfn><<legacy-hsl-syntax>></dfn> = hsl( <<hue>>, <<percentage>>, <<percentage>>, <<alpha-value>>? )
1988+
<dfn><<legacy-hsla-syntax>></dfn> = hsla( <<hue>>, <<percentage>>, <<percentage>>, <<alpha-value>>? )
19761989
</pre>
19771990

19781991
<wpt>
@@ -2117,17 +2130,8 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2>
21172130

21182131
</div>
21192132

2120-
For legacy reasons,
2121-
''hsl()'' also supports a <a>legacy color syntax</a>
2122-
that separates all of its arguments with commas:
2123-
2124-
<pre class='prod'>
2125-
hsl() = hsl( <<hue>>, <<percentage>>, <<percentage>>, <<alpha-value>>? )
2126-
</pre>
2127-
2128-
Also,
2129-
an <dfn>hsla()</dfn> <a>legacy color syntax</a> also exists,
2130-
with an identical grammar and behavior to ''hsl()''.
2133+
For historical reasons,
2134+
''hsl()'' and ''hsla()'' also support a <a>legacy color syntax</a>.
21312135

21322136
<wpt>
21332137
hsla-001.html

0 commit comments

Comments
 (0)