I’ve noticed that LibSass is about to be removed in v0.170.0, which means Sass users will need a separate Dart Sass executable next to Hugo. I understand why LibSass had to go, but I want to raise a problem this creates for users in restricted corporate environments like ours.
Our organization has the following restrictions:
Windows workstations where only signed and approved executables can run.
Third-party package managers (Chocolatey, Scoop, npm, Homebrew, etc.) are not allowed.
Every new executable needs its own security approval, which takes a long time.
Hugo extended is approved in our environment for website editors. Because LibSass was compiled into it, that one approval covered Sass as well. Dart Sass is a separate component with its own runtime, its own release cycle and its own source. The standalone ZIP from the Sass GitHub releases avoids package managers, but it’s still a new executable that needs its own approval, and I’m not sure it could pass under our current rules at all. Until it does, upgrading Hugo past v0.169 means losing Sass support.
I expect this isn’t unique to us; many corporate, government and regulated environments have similar rules.
One possible solution: Hugo already ships Dart Sass inside its Snap package, so Snap users don’t need to install it separately. Could a similar bundled release archive be published for Windows (and perhaps other platforms), with Hugo using the bundled copy automatically? That would bring back the “one approved artifact” model the extended build used to provide, and it would pin a Dart Sass version known to work with that Hugo release.
I’d be glad to hear other ideas, or how others in similar environments are handling this.
This is not a solution to your problem but you could consider moving to vanilla css.
I used sass heavily from around 2013 until last year. Modern css have come a long way! With native css nesting now having really good support in browsers I have moved all my current projects to vanilla css.
For Snap, that’s configured by us but packaged by someone else (Cannonical), and even then I suspect you’d be surprised if I told you how many hours we have spent maintaining that setup (the upstream build servers are shaky at best).
So, while we could add a MSI build for Windows with both Hugo and Dart Sass, it’s hard to do in a secure way. And taking that to the other platforms would make this even harder (with code signing and Apple notarisation etc.). It may happen, but not tomorrow.
Though I agree, SASS offers some facilities that haven’t made it yet into CSS – loops, conditionals and the like. All of that can obviously be written in CSS, but it might be a bit more tedious than using the SASS constructs.
For bigger/more complex setup, SASS is obviously very useful, but using css.Build passing in a map of CSS variables (e.g. from hugo.toml) is very lightweight and convenient.
I had Claude port a Sass based theme to CSS the other day, and it did so without hickups. The Sass stylesheets lived in a upstream module so it’s a little bit hard to grasp the before/after, but I’m pretty happy with the result:
Although this may not be an option for you, I think it’s important to note that a Snap package is conceptually similar to a Docker image because both are containerized environments that package an application together with its required runtime dependencies.
Just as the Hugo Snap package bundles Dart Sass, the official Hugo Docker image embeds Dart Sass inside the container.
That’s a good idea, I think we’ll explore it (with conversion being done with AI). But without detailed analysis it looks quite complicated, since we use a framework with a lot of mixin/functions. In many cases it would mean losing some flexibility and expressiveness. But for the project of our scale with 20 years of history it is not gonna be that easy.
Okay, should I create an issue so that this question won’t get lost and you could circle back to it, once you have the time and resources?
I think you should immediately pursue corporate approval of the Dart Sass executable as provided by the Sass team. If they don’t approve the app, you can’t do your job.
I am not in favor of somehow bundling this into anything other than the Snap package and Docker image.
Thanks for the explanations, I understand the reasoning, and the Snap/Docker point makes sense.
One thing I’d like to point out, since I think it’s easy to miss: this isn’t only a switch from LibSass to Dart Sass. Until now, Sass support came with Hugo extended, wherever and however you installed it. From v0.170.0, it depends on the distribution. The Snap package and the Docker image include Dart Sass, while the release archives and package-manager installs (Windows, macOS and most Linux setups) don’t, so there it becomes an external dependency you install separately and not a feature you get out of box.
For most users that’s one more install step. For environments like ours it’s a bigger change: a feature we had through the Hugo approval now needs a separate approval for a separate tool. That’s why I raised it, and I think it’s worth stating clearly in the release notes and docs which distributions include Sass and which don’t, so teams in similar setups find out before they upgrade rather than after.
We’ll see what we can do in our situation. Thanks again for your replies.