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
  • !34137

The breakpoint-min() function should return null for the first element

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/zerustech/topic-breakpoints-infix into main May 29, 2021
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: zerustech

Description

The breakpoint-min() function should return null for the first element in the map, even if its value is not 0. Currently, this function returns null only when the value is 0, so when calling this function with a map other than $grid-breakpoints, such as $container-max-widths, it will return the value of the first element, instead of null.

Also, the scss/_container.sass script directly generates responsive container selectors with .container-#{$breakpoint}, instead of .container#{breakpoint-infix($breakpoint, $container-max-widths)}, so it may generate unnecessary selectors such as .container-xs under certain circumstances.

How to Reproduce

Initialization

$ cd ~
$ mkdir test
$ cd test
$ yarn init -y
$ yarn add --dev sass bootstrap

Create a Test File

Create test.scss with the following content:

// test.scss
@import "node_modules/bootstrap/scss/functions";                                                                         
$container-max-widths: (                                                                                                 
  xs: 540px,                                                                                                             
  sm: 540px,                                                                                                             
  md: 720px,                                                                                                             
  lg: 960px,                                                                                                             
  xl: 992px,                                                                                                             
  xxl: 992px                                                                                                             
);                                                                                                                       
@import "node_modules/bootstrap/scss/variables";                                                                         
@import "node_modules/bootstrap/scss/mixins";                                                                            
@import "node_modules/bootstrap/scss/containers";                                                                        
@import "node_modules/bootstrap/scss/navbar"; 

Test

$ yarn sass test.scss test.css

You should be able to find a few selectors that include .container-xs in test.css, which is incorrect because any presence of .container-xs should have been replaced by .container.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/zerustech/topic-breakpoints-infix