mcrumm

mcrumm

Phoenix Core Team

If you would like to migrate away from node/npm/webpack while still using sass, the dart_sass package provides a installer and runner for Dart Sass via Mix.

This package follows the same structure esbuild– you add your configuration to config.exs:

config :dart_sass,
  version: "1.36.0",
  default: [
    args: ~w(css/app.scss ../priv/static/assets/app.css),
    cd: Path.expand("../assets", __DIR__)
  ]

and then you can run it from your command line:

$ mix sass default --version
1.36.0

For any Phoenix projects currently using Sass via webpack, you can use dart_sass to model your asset pipeline in the upcoming style of the Phoenix v1.6 installer.

First, add DartSass as a watcher in config/dev.exs:

sass: {
    DartSass,
    :install_and_run,
    [:default, ~w(--embed-source-map --source-map-urls=absolute --watch)]
  }

Note: this requires Phoenix > v1.5.9.

…and then create or add sass to your "assets.deploy" alias in mix.exs:

"assets.deploy": ["sass default --no-source-map --style=compressed", "phx.digest"]

You may refer to the README for more details, and if you are using dart_sass in a project, please let us know!

https://github.com/CargoSense/dart_sass

Showing Posts 1 to 10

tj0

tj0

This looks awesome. I can’t wait to not have to install node or npm ever again.

wanton7

wanton7

Maybe Elixir installation could include Wasm runtime in the future so these tools wouldn’t need its own. Then you could run these tools as wasm binaries in any OS. Dart for example is looking into Wasm compilation https://medium.com/dartlang/experimenting-with-dart-and-wasm-ef7f1c065577

hauleth

hauleth

While it seems awesome I would really like to see something like PostCSS with postcss-preset-env, so I would be able to use CSS-proposed nesting and other features from CSS proposals instead of SCSS “custom” solutions.

chrismccord

chrismccord

Creator of Phoenix

The goal is to sidestep the node ecosystem and related baggage/reproducible builds by installing the precompiled binaries for DartSass in this case. If postcss could provide something similar that would be amazing, but afaik this is not something easily done given postcss’s node implementation.

hauleth

hauleth

I know. My question was more “maybe someone know something like PostCSS that is built into native executable”.

chrismccord

chrismccord

Creator of Phoenix

Gotcha. Agree this would be amazing since I really love tailwind (which heavily builds on postcss), but the long term repeatability of my css builds years down the road is a concern without such a thing.

tj0

tj0

You might want to check out GitHub - mnussbaumer/cssex: A native Elixir CSS pre-processor - similar to SCSS/SASS but different · GitHub . It supports nesting, etc. Still haven’t gotten around to really testing it, but the option is there. Not sure how it compares to postcss.

derek-zhou

derek-zhou

I love the idea. I’d suggest to build something that is source compatible to a curated subset of tailwind/postcss, usable without any Elixir specific syntax. This way it can have a much larger audience.

mcrumm

mcrumm OP

Phoenix Core Team

I wonder if one could build a standalone PostCSS binary with something like vercel/pkg :thinking:

connorlay

connorlay

Hypothetically speaking, if one were to port PostCSS to Deno, would that fulfill your goal of sidestepping Node? Or would the same issues regarding reproducible builds persist?

EDIT: Deno support · Issue #1430 · postcss/postcss · GitHub

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
CodeSync
:microphone: ElixirConf 2026 - Call for Talks is open! We’re heading to Chicago :united_states: :round_pushpin: In person + virtual :d...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews