Skip to content
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

Closed
wants to merge 20 commits into from

Conversation

@Crissov
Copy link
Contributor

Crissov commented Jan 1, 2017

My git-fu isn’t strong enough yet to split this nicely into separate pull requests.

Length units

Viewport-relative length units

  • vi and vb logical viewport units. – were already included (#113, #323)

Relative length units

Absolute length units

  • Add the m, dm and mu metric units. (#315)
  • Add the dd and cc metric typographic units. (#315)
  • Add the thm, mdl metric English units.
  • Add the dot greatest common divisor unit. (#315)
  • Add the yd, ft and hd English units. (#315)
  • Add the sx, tx and twip English fractional typographic units. (#315, #378)
  • Add the ax, ay, bx, by, cx and cy paper units. (#328, #378)

Anthropometric/physiological length units

  • Add the tip, tap, mark, pad, span and sole anthropometric units. (#614, #837)

Angle units

  • Add the moa and soa angular units.
  • Add the pi circular unit. (#309)
  • Add the perm slope unit.

Duration units

  • Add the classic min and h units.
  • Add the psychological now and mom units. (#837)
  • Add the physiological (heart) beat and (eye) blink units. (#837)
  • Add the technical jif unit.

Frequency units

  • Add the classic bpm unit.
@Crissov Crissov changed the title [css-values] Add several new units [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 Jan 1, 2017
@fantasai

This comment has been minimized.

Copy link
Collaborator

fantasai commented Jan 3, 2017

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.

@fantasai fantasai closed this Jan 3, 2017
Copy link
Contributor Author

Crissov left a comment

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>

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

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,

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

Line reflow

a value of 0.5em must be assumed.

<dt><dfn id="cap" lt="cap">cap unit</dfn>

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

new unit cap, discussed in #315, #660 and #661

@@ -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>

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

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>

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

Two new units for stroke widths, text mostly copied from em, mentioned in #239 and #459, proposed in #838.

@@ -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.

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

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.

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

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

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

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

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

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>>.

This comment has been minimized.

Copy link
@Crissov

Crissov Jan 3, 2017

Author Contributor

<<integer>> is a subset of <<number>>, but mentioning it explicitly should make the next line less surprising.

@Crissov

This comment has been minimized.

Copy link
Contributor Author

Crissov commented Jan 3, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.