Skip to content

SCSS Setup

Before you can compile or customise the SCSS, you need to install the npm dependencies and have the Sass compiler available.

Install Sass globally if you don’t already have it:

Terminal window
npm install -g sass

From the Umbootstrap.Web/ directory, run:

Terminal window
npm install

This installs Bootstrap’s SCSS source into node_modules/, which the project imports directly.

From the Umbootstrap.Web/ directory, compile the SCSS to CSS:

Terminal window
sass SCSS/index.scss wwwroot/css/Index.css

To automatically recompile whenever you save a change:

Terminal window
sass --watch SCSS/index.scss wwwroot/css/Index.css

Leave this running in a terminal while you work. Each save will recompile the CSS.

FilePurpose
SCSS/index.scssEntry point — controls the full import order
SCSS/_variables_overrides.scssOverride Bootstrap variables before Bootstrap loads them
SCSS/_variables.scssAdditional variables defined after Bootstrap (e.g. custom colour scales)
SCSS/_overrides.scssOverride Bootstrap maps (e.g. merge custom colours into Bootstrap’s colour maps)
SCSS/_utilities.scssCustom utility classes, merged into Bootstrap’s utilities map
SCSS/_type.scssTypography overrides
SCSS/_navbar.scssNavbar component styles
SCSS/_nav.scssNav component styles
SCSS/_card.scssCard component styles
SCSS/_carousel.scssCarousel component styles
SCSS/_list-group.scssList group component styles

The compiled CSS is output to wwwroot/css/Index.css, which is referenced by the site’s layout view.