question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need a better documentation of "How to override variables in bootstrap"?

See original GitHub issue

using ttps://github.com/bootstrap-vue/webpack sample generated

added the following `<template>

<div class="appmenu"> <b-navbar toggleable="md" type="dark" variant="primary">
<b-navbar-toggle target="nav_collapse"></b-navbar-toggle>

<b-navbar-brand href="/index">Home</b-navbar-brand>

<b-collapse is-nav id="nav_collapse">

  <b-navbar-nav>
    <b-nav-item href="/appwizard">Register Application in Azure AD </b-nav-item>
  </b-navbar-nav>

  <!-- Right aligned nav items -->
  <b-navbar-nav class="ml-auto">
    <b-nav-item-dropdown right>
      <!-- Using button-content slot -->
      <template slot="button-content">
        <em>User</em>
      </template>
      <b-dropdown-item href="#">Signout</b-dropdown-item>
    </b-nav-item-dropdown>
  </b-navbar-nav>

</b-collapse>
</b-navbar> <span class="red">{{ menumsg }}</span> junk </div> </template> <style> bg-primary { background-color: #3f3f3f!important; } </style>

` works but not

`

<style> .bg-primary { background-color: #3f3f3f; } </style>

`

How to do this without !important

how to override primary such that all values of $primary in bootstrap are replaced since bootstrap-vue recommends to use css files and components and variant components

Also, Need a better documentation with example of how to override variants than explained here: https://bootstrap-vue.js.org/docs/reference/color-variants/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
robcresswellcommented, Mar 19, 2018

Can you fix the highlighting in your issue post? It’s quite hard to read.

In terms of theming, the easiest thing to do is import your variables globally in webpack. For me this looks like

rules: [
  {
    test: /\.vue$/,
    loader: "vue-loader",
    options: {
      loaders: {
        scss: "vue-style-loader!css-loader!sass-loader?data=@import './src/scss/variables.scss';",
        preserveWhitespace: false
      }
    }
  }
  ...
]

And then variables.scss contains all of my custom variables or variable overrides, then imports the bootstrap variables after. This means it uses my variables and then defaults to bootstrap for the rest. This also means that these variables are available in all of my components <style> blocks.

0reactions
SimonFrickercommented, May 21, 2020

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Theming Bootstrap
Override a variable's value and recompile with npm run test as needed. You can find and customize these variables for key global options...
Read more >
How to Edit, Customize, and Override Bootstrap CSS to Suit ...
Learn how to override Bootstrap CSS using simple CSS overrides or Sass variables and maps to customize your site.
Read more >
Overriding Bootstrap 4.0 Variables - Walkthrough - YouTube
One of the most powerful things you can do with Bootstrap is to override variables that control the colors, fonts, breakpoints and more....
Read more >
Howto override Bootstrap variables? [#3164909] | Drupal.org
Reproduce all the steps in the theme page and readme. Copy some variables from @import "../_npm/node_modules/bootstrap/scss/bootstrap"; to / ...
Read more >
How To Override Bootstrap-Sass Using Sass Variables?
We know that we have to override the Bootstrap style to give a new look to the website. Just like for theme-background, fonts,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found