Skip to main content
Bluvy Tube
Press Esc to exit fullscreen
Volume m
/
i
Theater mode t
f
/
What should happen with text-box-trim and margin-trim when it comes to negative values? Do negatives 'trim'?

Keyboard shortcuts

Space K
Play / pause
← →
Back / forward 5 s
J L
Back / forward 10 s
0–9
Jump to 0%–90% of the video
Home End
Start / end
, .
Previous / next frame (while paused)
< >
Slower / faster
↑ ↓
Volume
M
Mute / unmute
C
Captions
F
Fullscreen
I
Picture-in-picture
T
Theater mode
?
Show this help

What should happen with text-box-trim and margin-trim when it comes to negative values? Do negatives 'trim'?

0 views Published on 20/08/2026 13:03
What should happen with text-box-trim and margin-trim when it comes to negative values? Do negatives 'trim'?
4 comments
?
My first instinct would be to expect it to do nothing... But I guess there could be use cases where going the opposite might be useful?! 🤔
Definitely need to play around a bit with those 2.
Haven't played with it, but for me it makes sense that properties just keep doing what they're meant to.

So like, if there's a negative margin, and then margin-trim was also added, both should do what they were meant to do. This way, it is visible and the dev can make adjustments.
Sajid Anwar @sajidanwar.com · 20/08/2026 17:14
My suspicion is that while it might be weird to discard negative leading for vertical centering use cases, not discarding it for top/bottom alignment would be *much* weirder. If you want to align a heading to an adjacent image, the intent would be that the trim edge is always respected (I think).
Sajid Anwar @sajidanwar.com · 20/08/2026 17:14
Like in this example - codepen.io/kbhomes/pen/... - when `text-box: trim-start cap text` is what the author selected, it seems wrong for the cap-height to not be aligned with the image in all cases.

(Pen forked from @jensimmons.bsky.social which was extremely helpful during implementation!)
`text-box-trim`, negative leading, over alignment
...
View original post on Bluesky
Link copied to clipboard

Sign in

Time to take a break

You've been watching videos for 30 minutes straight: give yourself 5 minutes away from the screen. Stand up, stretch, grab a glass of water… Your videos will be right here when you're back.