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

Customization Options docs could be clearer about variable overrides #23963

Closed
ianbrandt opened this issue Sep 16, 2017 · 4 comments
Closed

Customization Options docs could be clearer about variable overrides #23963

ianbrandt opened this issue Sep 16, 2017 · 4 comments

Comments

@ianbrandt
Copy link

ianbrandt commented Sep 16, 2017

The customizing options doc says:

Every Sass variable in Bootstrap 4 includes the !default flag, meaning you can override that default value in your own Sass even after that original variable’s been defined. Copy and paste variables as needed, modify the values, remove the !default flag, and recompile.

I read this to mean that I can override variables in my Sass after importing bootstrap.scss:

@import "../../node_modules/bootstrap/scss/bootstrap.scss";
@import "my-overrides"

_my-overrides.scss:

$link-color: map-get($my-colors, link);

Per the Sass docs for !default variables:

...if the variable has already been assigned to, it won't be re-assigned, but if it doesn't have a value yet, it will be given one.

So really, I have to do overrides before Boostrap imports _variables.scss:

@import "my-overrides"
@import "../../node_modules/bootstrap/scss/bootstrap.scss";

I think the docs could be a little clearer in this regard.

@andresgalante
Copy link
Collaborator

@ianbrandt I agree with you. Do you want to send a PR to fix it? If not I can send it for you

@Bobeta
Copy link
Contributor

Bobeta commented Sep 21, 2017

@ianbrandt I read it the same way as you and sent a PR

@mdo
Copy link
Member

mdo commented Oct 2, 2017

This has been updated and more is coming in #23611.

@mdo mdo closed this as completed Oct 2, 2017
@ianbrandt
Copy link
Author

Thanks, all!

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

5 participants