CSS Layouts: A Critical Analysis

2025-08-06

This article offers a critical analysis of CSS layout mechanisms. The author argues that CSS conflates rich text styling and the layout system, leading to inconsistent inheritance—text styles inherit, but layout properties don't. Nested inline-block and inline-flex models exemplify this conflict: internally they're block or flex, externally they're inline. The author proposes that an ideal layout system would decompose behavior into independent facets, offering a more flexible and intuitive API than the current subtractive one with extra containment barrier hints. Finally, the article touches upon the limitations of relative em scaling and improvements in pixel handling.

Read more
Development

Sub-pixel Distance Transform: A Breakthrough in High-Quality Font Rendering for WebGPU

2024-12-26

This article delves into the challenges and solutions for achieving high-quality font rendering in WebGPU. Addressing shortcomings in existing Signed Distance Fields (SDFs) generation methods, the author presents a novel sub-pixel accurate distance transform algorithm (ESDT). ESDT cleverly combines CPU and GPU strengths, employing an improved Euclidean Distance Transform to effectively solve the deviations encountered in traditional methods when handling sub-pixel accuracy and grayscale pixels. The result is precise rendering of various fonts, including emojis, significantly enhancing font rendering quality.

Read more