[css-inline] vertically align to middle of cap height
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
vertical-align: middle will align an element with the baseline of text minus half its x-height. This makes it a poor fit for glyph-sized elements like icons, which will always look a tad too low. Ideally we’d have a keyword (vertical-align: text-middle?) that would align with the middle of the cap height of the typeface instead…

In lieu of this property, I see two dominant techniques for accomplishing this:
- The icon position is adjusted manually, using
top: -1pxor similar. This requires the icon to beinline-block, since other positioning techniques will conflict with thetopvalue. - The icon and text must be wrapped in a container with
display: flex; align-items: centeror similar. But this prevents the icon from being used inline.
(I was encouraged to submit this issue after writing about the idea.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the issue description of vertical-align: middle, the proposed text-middle keyword, and the linked typeface-median article. Compare the two existing alignment techniques described there and determine the specification and design work needed for cap-height alignment; done means the CSS Working Group has a settled, implementable direction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- design, frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100