Email or username:

Password:

Forgot your password?
2 posts total
Roma Komarov

New post: “Cap-Height Vertical Align”.

blog.kizu.dev/cap-height-align

The new year is here, and, with it, a season where people put out their CSS wishlists for the future.

One thing caught my attention in @tylersticka’s list: an ability to vertically align to the middle of the font’s cap-height.

I am thrilled to report that there are at least two relatively ok workarounds available in the most recent browsers, courtesy of the new `cap` unit!

Show previous comments
Roma Komarov

(oops, forgot to put hashtags for the post's announcement: #CSS and #Typography — here you go!)

Roma Komarov

For years, what I was mindlessly doing instead: applying a negative margin with “random” values of 0.2em-0.3em for cases like this, which, coincidentally, almost the same!

Intuitively, and by testing, I was pleased with these values all this time, but having a proper method on one hand, and a confirmation that this type of adjustment results in what the fallback ends up being in the end is nice, haha.

Roma Komarov

Last boost: oh, I just thought that to work around the adblock-blocking, something in Firefox or the uBlock Origin was just slow, but that is, in fact, just an added timeout for 5s just for Firefox on YouTube.

Good job, Google! I've recently started to listen to the Internet History Podcast (thanks, @Schepp for the recommendation), and oh how similar these tactics are to what MS did employ in the 90s.

Don't be evil — be chaotic evil, I guess.

Go Up