Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current sulution "customize/sass" is wrong - SASS variable don't set value by reference as CSS #33353

Closed
WinterSilence opened this issue Mar 14, 2021 · 1 comment

Comments

@WinterSilence
Copy link
Contributor

WinterSilence commented Mar 14, 2021

@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/mixins";

// Your variable overrides
$body-bg: #000;
$body-color: #111;

if you do this you change only current values of variable, no effect on variables used that's values to generate self values.

Right solution is:

// Your variable overrides
$body-bg: #000;
$body-color: #111;

@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/mixins";

Example

current solution:

@import "variables";
// `_variables.scss`:
// $a: 1 !default;
// $b: $a + 10 !default;
$a: 2;
@debug $a;  // display 2
@debug $b;  // display 11 - invalid

right way:

$a: 2;
// `_variables.scss`:
// $a: 1 !default;
// $b: $a + 10 !default;
@debug $a;  // display 2
@debug $b;  // display 12 - valid
@WinterSilence WinterSilence changed the title Current sulution "customize/sass" is wrong - SASS variable do't set value by reference Current sulution "customize/sass" is wrong - SASS variable don't set value by reference Mar 14, 2021
@WinterSilence WinterSilence changed the title Current sulution "customize/sass" is wrong - SASS variable don't set value by reference Current sulution "customize/sass" is wrong - SASS variable don't set value by reference as CSS Mar 14, 2021
@ffoodd
Copy link
Member

ffoodd commented Mar 14, 2021

Duplicates #33070.

There are a few related issues and discussions about the best way to override variables and how to improve Bootstrap customization ease.

Closing this as duplicate but be sure we're aware of this, and feel free to comment in related issues.

@ffoodd ffoodd added duplicate and removed feature labels Mar 14, 2021
@ffoodd ffoodd closed this as completed Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants