Hasty Briefsbeta

Bilingual

Hugo's New CSS Powers

7 hours ago
  • #Web Development
  • #CSS
  • #Hugo
  • Hugo v.0.158.0 introduced the css.Build function, offering enhancements for CSS handling but with limitations.
  • css.Build enables CSS bundling and minification out-of-the-box, working quickly for development.
  • It uses esbuild, with its capabilities and restrictions documented in esbuild's CSS-specific features.
  • css.Build may not convert all modern CSS features, requiring post-processing or targeting specific browsers.
  • Alternatives include Sass pre-processing, which supports nesting and bundling but no browser-prefixing.
  • PostCSS post-processing offers transpilation and minification but is slower due to JavaScript.
  • Lightning CSS is fast but requires 'shoehorning' into Hugo and lacks file-watching for development.