dgamidov
Hi folks,
Just a short instruction. Maybe it will help somebody.
Install boostrap with deps and Sass:
cd assets
npm install jquery --save-dev
npm install tether --save-dev
npm install bootstrap@4.0.0-beta.2 --save-dev
npm install popper.js --save-dev
npm install sass-brunch --save-dev
Delete old boostrap:
rm css/phoenix.css
Switch css to scss:
mv css/app.css css/app.css.scss
Edit css/app.css.scss:
@import "bootstrap";
Edit js/app.js:
import "bootstrap";
Edit brunch-config:
stylesheets: {
joinTo: "css/app.css",
order: {
after: ["web/static/css/app.css"] // concat app.css last
}
plugins: {
babel: {
// Do not use ES6 compiler in vendor code
ignore: [/vendor/]
},
sass: {
options: {
includePaths: ["node_modules/bootstrap/scss"], // Tell sass-brunch where to look for files to @import
precision: 8 // Minimum precision required by bootstrap-sass
}
}
},
npm: {
enabled: true,
globals: {
$: 'jquery',
jQuery: 'jquery',
Popper: 'popper.js',
Tether: 'tether',
bootstrap: 'bootstrap'
}
}
Trending in Guides/Tuts
# ~/src/livebook/.iex.exs
System.cmd("xdg-open", [ LivebookWeb.Endpoint.access_url() ] )
Because Livebook requires a unique passcode on ...
New
Other Trending Topics
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
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
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
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
iwarshak
Thanks for sharing. I spent quite a while trying to figure out why my app.scss was being ignored. It seems that it had to be named app.css.scss for sass-brunch to pick it up.
dgamidov
Bootstrap 4 was released, so we can now use it:
npm install bootstrap@4.0.0 --save-devdogweather
Thank you so much for the post! Working for me.
mbenatti
Just a Addition to this topic,
months ago I wrote a tutorial: Installing Bootstrap 4 + Font Awesome from NPM in Phoenix Framework using sass · GitHub
njwest
Thanks for this, very useful!
Just a quick note, if you use bootstrap@4.0.0 instead of beta-2, I don’t think you need tether anymore
AndyL
Related: there is a new version of
webpackwhich is supposed to reduce configuration overhead. It would be great if there were a simple/fast way to spin up a sample Phoenix app with an alternate JS config…Question:
mix phx.newhas a--no-brunchoption. Is there a way to plug in a custom JS generator, one that spits out the right package definitions and configs for a given JS environment??OvermindDL1
Sure, you can define your own new project templates and package them up in to their own runners.