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

More clearly how to remove from map #25573

Closed
ysds opened this issue Feb 7, 2018 · 1 comment
Closed

More clearly how to remove from map #25573

ysds opened this issue Feb 7, 2018 · 1 comment

Comments

@ysds
Copy link
Member

ysds commented Feb 7, 2018

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.

@XhmikosR
Copy link
Member

XhmikosR commented Feb 7, 2018

PR welcome :)

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