RSS FeedTwitterMastodonBlueskyShare IconHeart IconGithub IconArrow IconClock IconGUI Challenges IconHome IconNote IconBlog IconCSS IconJS IconHTML IconShows IconGit IconSpeaking IconTools IconShuffle IconNext IconPrevious IconCalendar IconCalendar Edit Icon
A series of images of an avatar doing a bunch of skateboard tricks.
atom@argyleink
notecss

This line of code is about to be in every single stylesheet.

h1, p, button {
  text-box: trim-both cap alphabetic;
}

Centering in CSS is about to get even finer grained.

Try it demo 1demo 2demo 3

Join the conversation on

65 likes
17 reposts
  • Jon Henshaw :coywolf:
  • Apple Annie :prami:
  • Jonathan Dallas
  • Iron
  • Tony Ward
  • Fynn Becker
  • bmsuseluda
  • Nilesh Prajapati
  • Toby Evans
  • Tyler Sticka
  • Ryan Mulligan
  • Steven Fail / imgradeone
  • Daniel P H Fox
  • Jeroen Zwartepoorte
  • mrtnvh
  • Germán Freixinós
  • Paul Shryock
I'm in love, and pretty sure you will be too: #CSS `text-box` more demo's and a one-liner you're going to include in your CSS fo sho, on my site ⤷ nerdy.dev/text-box-ftw
Adam ArgyleAdam Argyle

currently behind a flag in Canary and Safari!

here's boxes with equal sides of padding. the ones actually in the center are trimmed to the cap size of letters

Adam ArgyleAdam Argyle

another example. without trim, there's dead space above and below the lines of text ✂️

Adam ArgyleAdam Argyle

now half leading will be optional instead of the only option

Adam ArgyleAdam Argyle
Interesting. I like the border effect. And the rotated text - kewl!
Bob DinittoBob Dinitto
I always second guess my CSS when I see this. Love this fix!
Zach NeibaurZach Neibaur

@argyleink it is time that all browser see the importance of this. it is such a pain to align several fonts with each other or icons

bmsuseludabmsuseluda

@argyleink It sounds exciting but tbh, without context, or a browser that supports it, I don't get it.

Mikael GramontMikael Gramont
Yes! Been waiting for this for so long. The Seek folks did an amazing job with the Capsize lib, but it’ll be great to have this finally available natively.
Jeff StrandingJeff Stranding
Always designing in browser first! Wow this is nifty!!
Tim HolmanTim Holman

Crawl the CSS Webring