Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #23963
Closed
Open
Issue created Sep 16, 2017 by Administrator@rootContributor

Customization Options docs could be clearer about variable overrides

Created by: ianbrandt

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.

Assignee
Assign to
Time tracking