-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-values] Adding new units: en, cap, bs/hs; m/dm/mu, dd/cc, thm/mdl, dot, yd/ft/hd, sx/tx/twip, ax/ay/bx/by/cx/cy; tip/tap/mark/pad/span/sole; moa/soa, pi, perm; min/h, now/mom, beat/blink, jif; bpm #848
Conversation
- absolute length units: changed `am`…`cn` to `ax`…`cy` to avoid `am` and `cm` (now `by` though) - anthropometric length units: `tip`, `tap`, `thumb`, `palm`, `foot` - new <angle> units: `arcmin`, `arcsec`, `perm`; changed `pirad` to `pi` - new time units: * classic `min`, `h` * psychological `now`, `mom` * physical (heart) `beat`, (eye) `blink` * technical `jif`
thumb → mark palm → pad foot → sole arcmin → moa arcsec → soa some copyediting Privacy concerns
Please do not issue pull requests for significant changes. These changes need to be discussed and approved by the CSSWG before any text is added to the spec, and pull requests are not an appropriate place for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description and links to existing issues
@@ -942,20 +953,38 @@ Font-relative lengths: the ''em'', ''ex'', ''ch'', ''ic'', ''rem'' units</h4> | |||
will be 20% greater than the computed font size inherited by <code>h1</code> elements. | |||
</div> | |||
|
|||
<dt><dfn id="rem" lt="rem">rem unit</dfn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved rem
next to em
the glyph for the lowercase "o" extends below the baseline, and | ||
subtract that value from the top of its bounding box. In the cases | ||
where it is impossible or impractical to determine the x-height, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line reflow
a value of 0.5em must be assumed. | ||
|
||
<dt><dfn id="cap" lt="cap">cap unit</dfn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -978,27 +1007,62 @@ Font-relative lengths: the ''em'', ''ex'', ''ch'', ''ic'', ''rem'' units</h4> | |||
(i.e. 'writing-mode' is ''vertical-rl'' or ''vertical-lr'' | |||
and 'text-orientation' is ''text-orientation/upright''). | |||
|
|||
<dt><dfn id="ic" lt="ic">ic unit</dfn> | |||
<dt><dfn id="en" lt="en">en unit</dfn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new unit en
, was once supported by Gecko, mentioned in #315
(in the few fonts with proportional fullwidth glyphs, an approximation) | ||
of a single <a href="http://unicode.org/reports/tr11/#Definitions">fullwidth</a> glyph’s <a>advance measure</a>, | ||
thus allowing measurements based on an expected glyph count. | ||
|
||
In the cases where it is impossible or impractical to determine the ideographic advance measure, | ||
it must be assumed to be 1em. | ||
|
||
<dt><dfn id="rem" lt="rem">rem unit</dfn> | ||
<dt><dfn id="bs" lt="bs">bs unit</dfn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -2273,7 +2609,35 @@ Changes</h2> | |||
Changes since <a href="http://www.w3.org/TR/css-values-3/">Level 3</a>: | |||
|
|||
<ul> | |||
<li>Added the ''vi'', ''vb'', and ''ic'' units. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tracking all proposed changes, line by line for maintainability, with Github issue IDs and grouping inside comments
@@ -2287,4 +2651,10 @@ Security and Privacy Considerations</h2> | |||
This specification defines units that expose the user's screen size | |||
and default font size, | |||
but both are trivially observable from JS, | |||
so they do not constitutate a new privacy risk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting to add new considerations for proposed units. Most of them are just as safe as existing ones.
<tr><th><dfn id="pt">pt</dfn> | ||
<td>points | ||
<td>1pt = 1/72th of 1in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use notation valid inside calc()
instead of a mix of English and code notation
<tr><th><dfn id="mdl">mdl</dfn> | ||
<!--nn, mod, ftm "metric foot"--> | ||
<td>modules | ||
<td>1mdl = 300mm = 12thm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New unit dot
or emu
for the greatest common denominator of the smallest units supported by CSS(3). Mentioned in #315.
@@ -1609,11 +1937,12 @@ Type Checking</h4> | |||
|
|||
<li> | |||
At ''*'', | |||
check that at least one side is <<number>>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<<integer>>
is a subset of <<number>>
, but mentioning it explicitly should make the next line less surprising.
@fantasai I agree that “these changes need to be discussed and approved by the CSSWG”, but I thought that, since pull requests are really just a special type of issue on Github, they were the “appropriate place for that”. Editors like you could just remove the parts the WG rejected. |
My git-fu isn’t strong enough yet to split this nicely into separate pull requests.
Length units
Viewport-relative length units
vi
andvb
logical viewport units. – were already included ([css-values] Logical equivalents for vw/vh units #113, [css-values] Added 'vi' and 'vb' to heading of section 5.1.2 #323)Relative length units
ic
and]en
advance units. ([css-values-4] minor quible about informative text in definition of the ic unit #357; [css-values] Traditional absolute length units #315)cap
unit. ([css-values] cap-height unit? #660, [css-values] Traditional absolute length units #315, [css-values] baseline-position unit? #661)bs
andhs
stroke units. ([css-text-decor] No way to set the underline width/thickness #239, [css-text-decor] Text underlines' positions cannot be fine-tuned #459, [css-values] Relative length units for stroke widths #838)Absolute length units
m
,dm
andmu
metric units. ([css-values] Traditional absolute length units #315)dd
andcc
metric typographic units. ([css-values] Traditional absolute length units #315)thm
,mdl
metric English units.dot
greatest common divisor unit. ([css-values] Traditional absolute length units #315)yd
,ft
andhd
English units. ([css-values] Traditional absolute length units #315)sx
,tx
andtwip
English fractional typographic units. ([css-values] Traditional absolute length units #315, [css-syntax][css-values] Awkward Decimal Fractions and Non-Finite Values #378)ax
,ay
,bx
,by
,cx
andcy
paper units. ([css-page] <page-size> Keywords #328, [css-syntax][css-values] Awkward Decimal Fractions and Non-Finite Values #378)Anthropometric/physiological length units
tip
,tap
,mark
,pad
,span
andsole
anthropometric units. ([css-values] Ability to address actual physical size #614, [css-values] Anthropometric length and time units #837)Angle units
moa
andsoa
angular units.pi
circular unit. ([css-values] Radians considered useless without π #309)perm
slope unit.Duration units
min
andh
units.now
andmom
units. ([css-values] Anthropometric length and time units #837)beat
and (eye)blink
units. ([css-values] Anthropometric length and time units #837)jif
unit.Frequency units
bpm
unit.