FOX UI Kit for Bootstrap
The FOX UI Kit for Bootstrap is a reference intended for developers building any internal application at FOX. It uses Bootstrap v4x.
If you're looking to build an enterprise-grade experience, please refer to the Lightning Design System version of this guide.
Installing & Customizing Bootstrap
Depending on how you're using Bootstrap in a project changes how it's compiled for use.
Option 1: Generate a custom build
-
Make sure the LTS version of NodeJS is installed: Installation guide
-
Clone the repository: Bootstrap on Github
-
Run
npm install -
Apply theme styles at the top of
scss/_variables.scss:$body-bg: #aaa; $blue: #bbb; // …etcNote: See the section on FOX Colors for more information on theming Bootstrap.
-
After theming is complete, run
npm run cssto generate a minified file atdist/css/bootstrap.min.css -
Integrate the CSS and JS files into your local project or upload to a CDN.
Option 2: Customize Bootstrap in an existing project
If you're using NPM and have a build process for Sass files already set up, you can import bootstrap directly into your project and customize it.
-
Add Bootstrap:
npm i --save bootstrap -
Create a dedicated Sass file as a container (paths below are examples):
$ touch src/scss/shared/_bootstrap.scss// in the container file you just created, // add FOX theme definitions to the top: $body-bg: #aaa; $blue: #bbb; // …etc // import bootstrap directly from node modules // this requires a relative path to node_modules @import "../path/to/node_modules/bootstrap/scss/bootstrap";Note: See the section on FOX Colors for more information on theming Bootstrap.
-
Import that file first into your top-level Sass file:
// in src/scss/main.scss for example: @import "shared/bootstrap"; // the rest of your @imports @import "shared/vars"; @import "pages/main"; // …etc -
The theme overrides present in
_bootstrap.scsswill affect the theme and will be built into your final compiled file.
FOX Colors
For the latest, and to get these colors in CSS, see the Invision DSM.
FOX-Branded Sass file
The following Sass block will apply FOX colors to Bootstrap:
// Named colors from DSM
$color-black-resin: #232222;
$color-fox-pop-blue: #004c97;
$color-fox-red: #d2232a;
$color-fox-gray: #e5e5e5;
$color-fox-dark-blue: #00263e;
$color-fox-dark-red: #830b0d;
$color-fox-light-blue: #008bcd;
// Begin Bootstrap customizations
$body-bg: $color-fox-pop-blue;
$blue: $color-fox-pop-blue;
$danger: $color-fox-red;This block can go in two places depending on how Bootstrap is integrated into your project:
-
In a cloned Bootstrap repository, add it to the top of
scss/_variables.scssthen build the project. -
In a package-managed app, create a
_bootstrap.scssfile, add the theming overrides, then:@import "../path/to/node_modules/bootstrap/scss/bootstrap";
For more details on both options, see Installing and Customizing Bootstrap.