scss import bootstrap code example

Example 1: react import bootstrap css

{/* The following line can be included in your src/index.js or App.js file*/}

import 'bootstrap/dist/css/bootstrap.min.css';

Example 2: vue import css

// To import global CSS, simply import the stylesheet in main.js or App.vue, 
// where it is easy to reference all global styles in one main file 
// (or create a styles-import.js file and import that file in your main.js file).

// main.js
import '~/assets/styles.css';

// To import css scoped to a component, we can't just @import within a scoped style element,
// as they will leak out.
// Instead, we need to dedicate an entire scoped style element to importing that file.

// Component.vue
// Do this:
<style scoped src="~/assets/styles.css"><style> // This will import the CSS scoped to this component only
// Not that:
<style scoped lang="css">
  @import "~/assets/styles.css"; // This will import the CSS globally
</style>

Example 3: ./node_modules/bootstrap/dist/js/bootstrap.bundle.js

npm i --save-dev bootstrap@next bootstrap-loader tether jquery

Example 4: ./node_modules/bootstrap/dist/js/bootstrap.bundle.js

npm install --save resolve-url-loader --dev

Example 5: bootstrap scss

$colors: (
  "blue": $blue,
  "indigo": $indigo,
  "purple": $purple,
  "pink": $pink,
  "red": $red,
  "orange": $orange,
  "yellow": $yellow,
  "green": $green,
  "teal": $teal,
  "cyan": $cyan,
  "white": $white,
  "gray": $gray-600,
  "gray-dark": $gray-800
) !default;

Tags:

Misc Example