Lightning_css - a wrapper to integrate LighningCSS into Elixir projects

Hi there :wave:
I wanted to share a new Elixir package that I’ve built and open-sourced, lightning_css. I wanted to use globs to resolve and bundle CSS files, and I noticed that ESBuild, the default build tool that Phoenix ships with, doesn’t support that for CSS. Luckily, Lightning CSS does, and it ships as a binary that’s easy to pull and use in the same way the ESBuild Elixir package does. Therefore, I went ahead and built it.

Please, give it a try and let me know if you encounter any issues or have ideas for how to improve it. The README contains instructions for how to integrate it into a Phoenix project. I’d also recommend checking out Lightning CSS’s documentation, which goes into detail talking about other CSS-processing capabilities, which I don’t plan to use, but that you might find useful.

Happy Elixir coding!

11 Likes

Good one. :slightly_smiling_face:
Lightning CSS is great. I have used it in place of several PostCSS plugins in the past.

If I’m not mistaken, Tailwind will start to use it instead of PostCSS, or it’s in their plans or something.

A post was split to a new topic: Phoenix and the Asset Pipeline