-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Labels
css-values-4Current WorkCurrent Work
Description
- CSS Rhythmic Sizing only deals with box and line heights for now
- actual value
<length>- affects: [css-borders] Add a 'hairline' border-width value #3720
Browsers may need to round the used value to a different actual value in order to match the capabilities of the output device, e.g. integer values of device pixels. Authors may be fine with or even benefit from a less precise actual value, e.g. when they are designing every length with a step value of 1px (CSS pixels) anyway. In addition to introducing a per-case math function like round() or mod() #2513, I would like to propose a cascading property to specify the desired accuracy of transforming any calculated value into a used value (which the browser may still need to change for the actual value).
length-precision: [auto | high | low | <length> | <step-unit> | <storage-unit> | integer]
|| [<round>]
<step-unit>: pixel | dot | twip | emu | um
/* <storage-unit>: [<positive-integer> bit]
| [signed? [crumb | nibble | byte | char
| [half | short | long | double | quad] [float? | int]]] */
<round>: up | down | nearest
| to-zero | from-zero | floor | ceilauto(ormedium):
default, depends solely on the capabilities of the user agent and hardware setup, should be smaller than1px(It's apparently 1/60, 1/64 and 1/100 of a pixel in current major implementations.)- relative:
higher:
if possible, a higher precision than used by default, e.g. by storing more bits per value, thus probably increasing display quality and decreasing rendering speedlower:
a lower precision than used by default, e.g. by storing less bits per value, thus probably decreasing display quality and increasing rendering speed
- absolute value:
<length>:
all computed lengths should be rounded to an integer multiple of the length specified,
e.g.1px
- absolute unity keyword:
um,mu,micro,micronormicrometer:
same as0.001mm, a micrometer
(The SI prefix symbolµ, i.e. a Greek small mu or my, can be substituted byuif the former is not available in the character set.)twip:
same as0.05pt, a twentieth of a pointemu:
all computed lengths should be rounded to an integer multiple of the English-Metric Unit defined for OpenXML, where 36 emu = 1 micrometerpixel:
all computed lengths should be rounded to an integer multiple of device pixels, where each pixel consists of the same number of (colored) sub-pixels; smaller or equal to1pxdot:
all computed lengths should be rounded to an integer multiple of the smallest graphic element the output device can address, e.g. sub-pixels for screens; smaller or equal topixelintegerorint:
all specified lengths should be rounded to an integer multiple of the unit specified, before being converted to the canonical unitpxfor the computed value<storage-unit>:
absolute and relative lengths in computed, used and actual values should be treated as if they were limited to n bits or, ifsignedis specified, n−1 bits, with n = {
1:bool/bit, 2:crumb, 4:nibble/quartet, 8:byte/octet,
16:half, 21:char, 24:short,
32:single/medium/float/int,
40:extended, 48:long, 64:double, 128:quad}.
The rounding behavior is based on an extended set of keywords taken from css-rhythm.
up:
If the absolute value is not an integer multiple of the step value, it is increased to the next one,
e.g.-1.5pxto-1pxand1.5pxto2pxfor a step value of1px.down:
If the absolute value is not an integer multiple of the step value, it is decreased to the previous one,
e.g.-1.5pxto-2pxand1.5pxto1pxfor a step value of1px.nearest:
The value is either increased (as forup) or decreased (as fordown) – whichever results in the smallest absolute change,
e.g.-1.3pxto-1pxand1.3pxto1pxfor a step value of1px.
If both options would result in the same amount of change, the size is increased,
e.g.1.5pxto2pxfor a step value of1px.odd:
same asnearestexcept when both options would result in the same amount of change,
the size is rounded to the odd multiple of the step value,
e.g.-0.5pxand-1.5pxto-1px,0.5pxand1.5pxto1pxfor a step value of1px.even:
same asnearestexcept when both options would result in the same amount of change,
the size is rounded to the even multiple of the step value,
e.g.-1.5pxand-2.5pxto-2px,1.5pxand2.5pxto2pxfor a step value of1px.
to-zeroorzeroorcenterorinorinwards:
same asdownfor positive values, same asupfor negative values,
e.g.-1.5pxto-1px,1.5pxto1pxfor a step value of1px.
0is left unchanged.from-zeroorto-infinityorinfinityorawayoroutoroutwards:
same asupfor positive values, same asdownfor negative values,
e.g.-1.5pxto-2px,1.5pxto2pxfor a step value of1px.
0is left unchanged.ceilorceiling:
same asup, but if the step unit isauto, it is treated like1pxfloor:
same asdown, but if the step unit isauto, it is treated like1pxnormal:
same asnearest, but with increase as forceiland decrease as forfloor
Metadata
Metadata
Assignees
Labels
css-values-4Current WorkCurrent Work