CSS Modules with Phoenix

It’s possible or anyone has any documentation or information about using CSS modules with Elixir like the Javascript world do with their own frameworks?

Yes it’s possible… but You need to configure how webpack will use css.

It also depends if You use a CSS framework, some needs jQuery, some postcss etc.

The entry point is assets/css/app.scss

MiniCssExtractPlugin will take care of bundling all css for You into a unique file.

There’s nothing built in for “css modules”. There’s no shared knowledge between the assets pipeline and whatever solution you’re using (e.g. phoenix views) for creating html markup.

Oh, css modules… sorry

I was thinking of css :slight_smile:

What are you using to generate the views? Specifically, what build tools are you using? Because if you use something like Webpack or Browserify you can just configure it there.