HeadlinesBriefing favicon HeadlinesBriefing.com

Hugo 0.158.0’s css.Build simplifies CSS pipelines

Hacker News •
×

Hugo 0.158.0 rolled out a built‑in css.Build pipeline that lets developers write native CSS nesting and other 2023‑baseline features without Sass or PostCSS. The function bundles, minifies, and optionally transpiles modern syntax, cutting the need for separate tooling in simple sites. However, the feature inherits the same browser‑support constraints as any modern CSS approach.

Under the hood, css.Build rides on the esbuild engine, pulling in its list of supported CSS features for transpilation and vendor prefixing. Developers can rely on automatic bundling and fast minification during development, but must verify that esbuild covers every syntax their design uses. When a feature falls outside the supported set, teams either add a post‑processor step or restrict the target browsers via Browserslist.

Compared with traditional pipelines, Sass still offers SCSS syntax, math functions and mixins but requires the Dart‑Sass binary and separate prefixing. PostCSS delivers extensive plugin support yet suffers from JavaScript overhead, while Rust‑based Lightning CSS is speedy but lacks native Hugo integration. For many projects, css.Build’s out‑of‑the‑box speed and simplicity make it a viable single‑tool solution, provided its compatibility gaps are addressed.