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

Bootstrap 5.2 remove utilities not working. #36436

Closed
3 tasks done
aboutjquery opened this issue May 25, 2022 · 3 comments · Fixed by #36444
Closed
3 tasks done

Bootstrap 5.2 remove utilities not working. #36436

aboutjquery opened this issue May 25, 2022 · 3 comments · Fixed by #36444

Comments

@aboutjquery
Copy link

aboutjquery commented May 25, 2022

Prerequisites

Describe the issue

I am using gulp to compile scss.
I used the following code directly from the documentation.

$utilities: map-merge(
  $utilities,
  (
    "width": null
  )
);

if I put this code after

@import "bootstrap/scss/utilities/api";
// HERE

nothing happens.

And if I put it in, an error occurred

@import "bootstrap/scss/utilities";
// HERE
@import "bootstrap/scss/utilities/api";

$map1: null is not a map.

Thanks.

Reduced test cases

@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
...other components scss
@import "bootstrap/scss/utilities/api";
$utilities: map-merge(
  $utilities,
  (
    "width": null
  )
);

// nothing happens.

or

@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
...other components scss
$utilities: map-merge(
  $utilities,
  (
    "width": null
  )
);
@import "bootstrap/scss/utilities/api";

// error: $map1: null is not a map.

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

v5.2

@mdo
Copy link
Member

mdo commented May 26, 2022

Blah, the docs are definitely wrong on this—the customization of the $utilities map needs to come before the api import, but after the rest of the imports. Your section example should work—it did for me at least testing locally. If you can confirm one more time, I'll open a PR.

Also, I think this might work, too:

$utilities: map-remove($utilities, "width");

If you could confirm that, we might want to update our docs to include that and fix the import order.

@mdo mdo added this to To do in v5.2.0-stable via automation May 26, 2022
@mdo mdo added docs and removed confirmed labels May 26, 2022
v5.2.0-stable automation moved this from To do to Done May 26, 2022
@aboutjquery
Copy link
Author

aboutjquery commented May 27, 2022

Thanks for reply.

I did a test, this working before utilities api import.

@import "bootstrap/scss/utilities";
$utilities: map-remove($utilities, "width");
@import "bootstrap/scss/utilities/api";

And not working after api, this without any warning or error, just nothing happens

@import "bootstrap/scss/utilities";
@import "bootstrap/scss/utilities/api";
$utilities: map-remove($utilities, "width");

I confirm one more times, this really working.

@import "bootstrap/scss/utilities";
$utilities: map-merge(
  $utilities,
  (
    "width": null
  )
);
@import "bootstrap/scss/utilities/api";

Thanks.

@mdo
Copy link
Member

mdo commented May 27, 2022

See #36444. The utilities map overrides should go between those two imports as shown in your first example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v5.2.0-stable
  
Done
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants