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

Making the customization option docs clearer about variable overrides #24033

Merged
merged 4 commits into from
Sep 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions docs/4.0/getting-started/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ toc: true

## Customizing variables

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.

For example, to change out the `background-color` and `color` for the `<body>`, you'd do the following:
Every Sass variable in Bootstrap 4 includes the `!default` flag, meaning you can override that default value in your own Sass. Copy and paste variables as needed, modify the values and remove the !default flag. If a variable has already been assigned, then it won't be re-assigned by the default values in Bootstrap. This means that your modified Sass variables should be called before you import Bootstrap Sass files. For example, to change out the `background-color` and `color` for the `<body>`, you'd do the following::

{% highlight scss %}
$body-bg: $gray-900;
$body-color: $gray-600;
// Your variable overwrite first or a Sass file containing the modifications
$body-bg: #000;
$body-color: #111;

// Then import Bootstrap
@import "node_modules/bootstrap/scss/bootstrap";
{% endhighlight %}

Do the same for any variable you need to override, including the global options listed below.
Expand Down