You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-egg-1/Overview.bs
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -430,6 +430,37 @@ This feature is useful for designing robust content that adapts to different dev
430
430
431
431
This API may be used for gleaning information about the user's environment, which may be used to fingerprint them. This is recognized to be an acceptable loss for the momentous benefits this API is expected to provide the web platform.
432
432
433
+
<h3 id="random">Random values</h3>
434
+
435
+
[[CSS-VALUES-5]] introduces ''random()'' to generate random values.
436
+
437
+
As that function has very limited use cases,
438
+
this specification introduces three <dfn>random value units</dfn> covering a broader range of randomness.
439
+
440
+
<table class="data" export>
441
+
<thead>
442
+
<tr><th>unit
443
+
<th>name
444
+
<th>definition
445
+
<tbody>
446
+
<tr><th><dfn style="white-space: nowrap">🎲</dfn>
447
+
<td>Random number
448
+
<td>Returns a random <<number>> value between ''0'' and the given <<number>> value.
449
+
<tr><th><dfn style="white-space: nowrap">🎲🎲</dfn>
450
+
<td>Random number and unit
451
+
<td>Returns a random <<dimension>> or <<percentage>> between ''0'' and the given value.
452
+
<tr><th><dfn style="white-space: nowrap">❓</dfn>
453
+
<td>Random value
454
+
<td>Returns a <<number>>, <<dimension>>, or <<percentage>> between ''0'' and the given value,
455
+
a <<color>>, <<string>>, or any kind of <a href="https://drafts.csswg.org/css-values-4/#keywords">pre-defined keyword</a>.
456
+
<tr><th><dfn style="white-space: nowrap">🎁</dfn>
457
+
<td>Complete randomness
458
+
<td>May return any kind of value defined in [[CSS-VALUES-5]],
459
+
including but not limited to <<number>>, <<dimension>>, or <<percentage>> values of any size,
460
+
a <<color>>, <<string>>, any kind of <<ident>>, or nothing at all.
461
+
It might even come up with new values not yet defined. Who knows?
0 commit comments