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
  • #25573
Closed
Open
Issue created Feb 07, 2018 by Administrator@rootContributor

More clearly how to remove from map

Created by: ysds

I think that a way to remove a key/value from Sass maps is not clear.

The theming page documents:

To remove colors from $theme-colors, or any other map, use map-remove:

$theme-colors: map-remove($theme-colors, "success", "info", "danger");

But, it is not clear where to insert it.

For example, the following SCSS to modify or add key/value works well:

$theme-colors: (
  "primary": #0074d9,
  "danger": #ff4136
);

@import "node_modules/bootstrap/scss/bootstrap";

But it does not work when write SCSS to remove key/value on the same place:

$theme-colors: map-remove($theme-colors, "success", "info", "danger");

@import "node_modules/bootstrap/scss/bootstrap";

To remove colors from $theme-colors, or any other map, map-remove should be written between the requires and the options:

// Required
@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
@import "node_modules/bootstrap/scss/mixins";

$theme-colors: map-remove($theme-colors, "success", "info", "danger");

// Optional
@import "node_modules/bootstrap/scss/reboot";
...

It would be more helpful if documented about this.

I have no time to create a demo about this issue, but I hope bootstrap team can easily confirm this by adjust the bootstrap.scss. thank you.

Assignee
Assign to
Time tracking