How to include a css ‘theme’ ?


Apologies for the noob question. I’m a mostly back end developer, not worked with front end much in the last few years. Build tools like Brunch and Webpack are totally new to me. I’ve tried to read up as much as I can with it and I’ve spent a couple of days struggling to use a theme I bought with Phoenix.

It comprises css js and images, and also it has a vendor directory containing css, js and images for dependencies, like bootstrap, jquery etc…

I’ve put them in ‘assets’ but I’m getting a js error about something being undefined. Also it can’t find the images.

I assume that the js error could be to do with the order things are being loaded, perhaps?

If anyone can give me a hint or two that would be much appreciated.

Thanks in advance.

1 Like

There is blog post concerning bootstrap + brunch here

I made a blogpost about webpack 4 here

I think theme is more related to the css You choose.

If You put file into priv/static, You will bypass build process. If your brunch config is ok, You should find generated files under priv/static. If bundle is ok, You should also reference them in application layout.

If You show your config, You might have more precise answer.


Some themes aren’t necessarily assembled in such a way that lends them to be processed by a module bundler. In that case you can only “drop” the theme directly into priv/static and use it from there, similar to this case.

Now the most recent version of jQuery itself can be processed through the modern asset toolchain but often themes that use jQuery (especially older versions) were not created with the modern asset tool chain in mind.

1 Like

Ok, that’s perfect for what I need to do right now. I read webpacker is coming in Phoenix 1.4 so I probably won’t invest any more time I trying to learn brunch.

Thank you both for your help. I really appreciate it.

Thanks for all the help so far. All works nicely in development. On deployment to production, apparently anything I manually put in priv is not included in the release. I’m using Edeliver with distillery, based on this guide from digital ocean:

It absolutely should! priv is the one directory that is included with the project verbatum! Maybe you have a script or something before hand that is cleaning out part of it or something? o.O?

1 Like

Hi and thanks for the reply.

I thought I’d create a new topic for this, because it’s more to do with deployment: