-
Notifications
You must be signed in to change notification settings - Fork 669
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] cap-height unit? #660
Comments
Google has proposed (and is implementing) the CSS Step Sizing module, which enables “vertical rhythm using CSS”. What do you think? 😊 |
There is also the CSS Line Grid module that also provides a CSS mechanism for vertical rhythm (including baseline snapping to regular grid lines). But I believe that having better access to the font metrics from CSS would have more use cases other than that. For example, it can be aligning the icon with text (both top and bottom) or removing extra vertical spacing before text (e.g. in the approach described in this article) without having to use magic numbers for each particular font. |
RESOLVED: add cap unit to Values and Units Level 4 per WG resolution |
Added. |
Thanks for this proposal for a Does anyone know of any browsers that have considered or started implementation of this? I've been looking for tracking bugs, but haven't been successful... |
Apparently none yet. https://caniuse.com/mdn-css_types_length_cap |
I've now created a feature request to implement it in Gecko (Firefox). Sebastian |
Great, thanks @SebastianZ! Tweeted about it: https://twitter.com/karlhorky/status/1378683467098165248 |
Just wanted to note that this is currently implemented in Firefox! There was also a ticket in Chromium for some time — https://bugs.chromium.org/p/chromium/issues/detail?id=1201220 |
I've just found out about the
ch
andex
units described here:https://www.w3.org/TR/css3-values/#relative-lengths
Cap height: This is something that could become extremely useful in vertical rhythm projects such as Sassline and MegaType, which go to great length to attempt to find this height through other means (plus a lot of manual config adjustment). When combined with
ex
(and a speculative baseline position), we also start to build up a very useful picture of a font's vertical metrics.The best measure of this is usually the height of a capital
H
in any font, but could likely also fall back toI
orX
.Is this something that might be considered in future?
Further reading on some existing issues with typographic metrics on the web
The text was updated successfully, but these errors were encountered: