#layout

No articles are currently tagged with 'layout'.
2 articles tagged with layout
The CSS vertical-align Problem Is Finally Solved: text-box-trim and margin-block

The CSS vertical-align Problem Is Finally Solved: text-box-trim and margin-block

For decades, centering text vertically in buttons, badges, and layouts felt slightly off. The culprit: leading space β€” invisible padding built into every font's metrics. Two CSS properties now solve this at different levels: text-box-trim for inline text and margin-block with cap/lh units for block layouts.
Pretext: The DOM-Free Text Measurement Library That AI Coding Agents Are Already Using

Pretext: The DOM-Free Text Measurement Library That AI Coding Agents Are Already Using

Cheng Lou just released Pretext, a pure JavaScript library that measures and lays out multiline text without touching the DOM. Here's why that matters for virtualization, layout control, and AI agents that write UI code.