Passer au contenu principal
Bluvy Tube
Appuyez sur Échap pour quitter le plein écran
Volume m
/
i
Mode Cinéma t
f
/
What should happen with text-box-trim and margin-trim when it comes to negative values? Do negatives 'trim'?

Raccourcis clavier

Espace K
Lecture / pause
← →
Reculer / avancer de 5 s
J L
Reculer / avancer de 10 s
0–9
Aller à 0 %–90 % de la vidéo
Home End
Début / fin
, .
Image précédente / suivante (en pause)
< >
Ralentir / accélérer
↑ ↓
Volume
M
Couper / rétablir le son
C
Sous-titres
F
Plein écran
I
Image dans l’image
T
Mode cinéma
?
Afficher cette aide

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

0 vue Publié le 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 commentaires
?
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
...
Voir le post d'origine sur Bluesky
Lien copié dans le presse-papier

Connexion

Il est temps de faire une pause

Ça fait 30 minutes que vous enchaînez les vidéos : accordez-vous 5 minutes loin de l'écran. Levez-vous, étirez-vous, buvez un verre d'eau… Les vidéos vous attendront ici.