Getting Started with Bootstrap 4 using Radix in Drupal 8
Radix is a Bootstrap 4 powered theme which is set up out-of-the-box to compile the Bootstrap library locally. It is targeted towards advance front-end developers who want total control on how Bootstrap is loaded and comes with Browsersync and Font Awesome built-in. The theme doesn’t support loading Bootstrap via a CDN out-of-the-box. I’d recommend you look at the Barrio theme if you prefer to load everything through a CDN.
Because you’re compiling Bootstrap, you get the added benefit of being able to modify the _variables.scss
which is used to customize Bootstrap and can control what SASS components get imported. By importing only what you need you can drastically reduce the size of the compiled CSS file.
The theme comes with a Drush command (Drush 8 only), drush radix "Theme name"
, which makes it easy to generate sub-themes. The sub-theme comes with a package.json
which has all the required packages.
Just run npm install
, then npm run dev
to compile Bootstrap. It uses laravel-mix to compile everything so you don’t have to spend time configuring webpack files.
In this tutorial, you’ll learn how to install Radix, create a sub-theme, how to compiling everything and learn about Radix Layouts.