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
  • Merge requests
  • !36535

Fix 'Remove from map' Sass description

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Julien Déramond requested to merge main-jd-fix-sass-remove-from-map-example into main Jun 09, 2022
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 1

Fixes #36534 (closed)

This PR proposes to fix #36534 (closed) by modifying the Scss example and the associated description (not very inspired, could maybe be improved).

Maybe $theme-colors is not representative enough of what's this section is trying to explain. Do we need to find another example based on another map?

Live preview


How to test it locally:

mkdir test && cd test
npm i bootstrap@5.2.0-beta1 sass
// styles.scss
@import "./node_modules/bootstrap/scss/functions";
@import "./node_modules/bootstrap/scss/variables";
$theme-colors: map-remove($theme-colors, "info", "light", "dark");
@import "./node_modules/bootstrap/scss/maps";
@import "./node_modules/bootstrap/scss/mixins";
@import "./node_modules/bootstrap/scss/root";
@import "./node_modules/bootstrap/scss/utilities";
@import "./node_modules/bootstrap/scss/reboot";
@import "./node_modules/bootstrap/scss/helpers";
@import "./node_modules/bootstrap/scss/utilities/api";
# Generate styles.css
./node_modules/.bin/sass styles.scss:styles.css
<!-- index.html -->
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap demo</title>
    <link href="./styles.css" rel="stylesheet">
  </head>
  <body>
    <h1>Hello, world!</h1>
    <div class="bg-info">test</div>
    <div class="bg-warning">test</div>
  </body>
</html>

If the modification of $theme-colors is done after root you'll observe a blue div. If it is done at the right place between variables and maps, only the yellow div will be displayed.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: main-jd-fix-sass-remove-from-map-example