CSS ch unit replaces px for content width on text sites
The post demonstrates a narrow but verifiable shift from px to ch/ex units for text containers. Primary evidence is limited to one author's CSS snippet with no comparative benchmarks. Broader context shows low current adoption and unexamined trade-offs in component-heavy layouts.
The post records an experiment replacing pixel declarations with ch for horizontal measures and ex for vertical ones on a primarily text site. It cites the CSS Values specification definition that 1ch equals the advance width of the zero glyph and notes that 1px does not map to a physical device pixel on high-DPI displays. No usage statistics or A/B test results are supplied; the change is presented as a personal preference aligned with readable line lengths.
HTTP Archive data from 2024 shows ch appearing in fewer than 3 percent of style sheets among the top 1000 sites, while px remains the dominant absolute unit. The post overlooks that container query length units and clamp() already provide similar fluid behavior without abandoning the pixel reference frame entirely. It also ignores performance or accessibility audits that would quantify whether ch values reduce reflows or improve screen-reader metrics.
Operationally the pattern favors sites whose primary constraint is line length rather than component grids or icon alignment. Adoption requires rewriting every margin, padding, and max-width rule that previously used px or rem, increasing stylesheet maintenance cost for teams without automated tooling. Future measurement will come from HTTP Archive crawls tracking ch and ex selectors across repeated snapshots.
Wider uptake depends on whether major frameworks expose ch defaults in their reset styles and whether browser devtools add dedicated ch/ex rulers.
HTTP Archive: ch unit share in top-1000 stylesheets exceeds 8 percent by Q4 2027 crawl.
Sources (3)
- [1]Primary Source(https://shkspr.mobi/blog/2026/08/death-to-px-long-live-ch/)
- [2]Supporting Source(https://www.w3.org/TR/css-values-4/#ch)
- [3]Supporting Source(https://httparchive.org/reports/tech/css-units)