r/webdev • u/Miragecraft • Oct 10 '26
Question Is * {text-box: cap alphabetic} the future?
Played around with it for the last few days as part of my base style.
I don't know, definitely looks better but my design needed quite a lot of extra styling to get back to a presentable state.
I do think this is the future of web design at least for myself, but I'd need to come up with some sensible default spacing in my base style to not start off my design from a broken state.
17
Upvotes
23
u/buycallsbro Oct 10 '26
Ohh, first I’m hearing of it, but definitely would be useful.
For anyone curious: https://css-tricks.com/almanac/properties/t/text-box/
2
u/tremby Oct 10 '26
Don't think so. It seems like it either be best used in specific cases where exact alignment is important: large display text, labels in tight containers, that sort of thing.
1
u/Background_Couple965 Oct 10 '26
the `*` is what gets me. we already did this once with box-sizing and every component with hand-tuned margins came back looking slightly wrong. cap alphabetic on body i'd buy, on the whole tree i'm not there yet
1
u/RequirementGuide Oct 10 '26
I've been using text-box-trim on a client project and I landed in the same place as a few people here. It's useful, but I would never do it as a global * reset. Targeted on display type, buttons and nav items is where it actually earns its keep.
One thing that bit me hard is trimmed links losing clickable area, same as you mentioned OP. It also does weird things to embedded content from third parties where you can't touch the inner markup. I ended up scoping it to my own component classes only.
The pairing with the cap unit for line-height is the real win for me. Once I did that the type actually sat on the baseline grid instead of just looking close. Worth the one-time setup, just don't blast it everywhere.
1
u/TheRNGuy Oct 10 '26 edited Oct 10 '26
Yeah, just not on
*(unlikebox-sizing), also, don't need it on::beforeand::after.But it will probably be in a generic reset.css file (not the
*version, of course)I wonder, how Tailwind users are gonna do it.
-1
u/Open_Appointment9671 Oct 10 '26
So it broke your layout, needed a pile of extra styling to look presentable, and you still think it's the future of web design? Also the screenshot is a Reddit ad for campaign automation.
7
u/[deleted] Oct 10 '26
[removed] — view removed comment
7
u/[deleted] Oct 10 '26
[removed] — view removed comment
0
u/[deleted] Oct 10 '26
[removed] — view removed comment