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.

<b-button variant="foo"> uses original bootstrap color, instead of variable override.

See original GitHub issue

Describe the bug

<b-button> variant does not inherit colors from the $theme-colors bootstrap scss variables like it is supposed to.

Steps to reproduce the bug

  1. Create a fresh project
  2. Create theme.scss and override $theme-colors per documentation e.g.
$theme-colors: (
  primary: #2D3047;
);
  1. In the template html, create <b-button variant="primary">Foo</b-button>
  2. Observe that the color of the button is not #2D3047 but instead #007BFF

Expected behavior

When creating a <b-button> with a variant and $theme-colors overridden, the variant of <b-button> should reflect the new $theme-colors color, not the original bootstrap color.

Versions

Libraries:

  • BootstrapVue: 2.12.0
  • Bootstrap: 4.4.1
  • Vue: 2.6.11

Environment:

  • Device: Desktop
  • OS: Windows 10 LTSC
  • Browser: Firefox
  • Version: 79

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Hiwscommented, Aug 25, 2020

I’ve never used @extend, so can’t say for sure. But you can refer to the link if you only need mixins, functions and variables in your SFC’s.

1reaction
Hiwscommented, Aug 24, 2020

Are you importing anything into a scoped style tag? <style scoped>.

data-v-xxxxxx is added when using scoped style tags to limit the CSS to that component only.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Theming Bootstrap
We use Sass maps for our colors, grid breakpoints, and more. Just like Sass variables, all Sass maps include the !default flag and...
Read more >
How to change btn color in Bootstrap - css - Stack Overflow
Now that Bootstrap 4 uses SASS, you can easily change the primary button color using the button-variant mixins: $mynewcolor:#77cccc; .btn-primary { @include ...
Read more >
Color Variants | Reference - BootstrapVue
Color variants available when using the default Bootstrap v4 CSS and their mappings to CSS classes.
Read more >
Discussions - GitHub
Bootstrap 5.1/5.2 Introduce CSS variables, but they don't work in emails. ... button-variant( $background, $border, $color: color-contrast($background), ...
Read more >
Features In-Depth | Less.js
This feature is not required because you can easily override a variable by putting the definition afterwards. For instance: // library @base-color: green;...
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