question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid value for $container-max-widths

See original GitHub issue

Using this grid container:

$container-max-widths: (
    sm: 100%,
    md: 100%,
    lg: 100%,
    xl: 1140px
);

Works, but leads to these warnings:

WARNING: Invalid value for $container-max-widths: This map must be in ascending order, but key 'md' has value 100% which isn't greater than 100%, the value of the previous key 'sm' !
Backtrace:
	node_modules/bootstrap/scss/_variables.scss:53, in mixin `-assert-ascending`
	node_modules/bootstrap/scss/_variables.scss:226

WARNING: Invalid value for $container-max-widths: This map must be in ascending order, but key 'lg' has value 100% which isn't greater than 100%, the value of the previous key 'md' !
Backtrace:
	node_modules/bootstrap/scss/_variables.scss:53, in mixin `-assert-ascending`
	node_modules/bootstrap/scss/_variables.scss:226

WARNING: Potentially invalid value for $container-max-widths: This map must be in ascending order, but key 'xl' has value 1140px whose unit makes it incomparable to 100%, the value of the previous key 'lg' !
Backtrace:
	node_modules/bootstrap/scss/_variables.scss:51, in mixin `-assert-ascending`
	node_modules/bootstrap/scss/_variables.scss:226

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
mdocommented, Apr 16, 2017

Closing as a dupe of #19113. You need to use pixels for these for now.

0reactions
tillkrusscommented, Apr 17, 2017

Solved it like this:

.container {
    @each $breakpoint, $container-max-width in $container-max-widths {
        @if $breakpoint != 'xl' {
            @include media-breakpoint-down($breakpoint, $grid-breakpoints) {
                width: 100%;
                max-width: 100%;
            }
        }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to refer to $container-max-widths in Bootstrap
I am currently working with Bootstrap 4 and I've made some changes to breakpoints - it looks like that: $container-max-widths: ( xs: 540px,...
Read more >
max-content - CSS: Cascading Style Sheets - MDN Web Docs
The max-content sizing keyword represents the intrinsic maximum width or height of the content. For text content this means that the content ...
Read more >
Container Block width confusion | WordPress.org
The dark green container is set to be full screen width. My error here is that I set the nested/light green container's “Inside...
Read more >
Containers · Bootstrap v5.2
The table below illustrates how each container's max-width compares to the original .container and .container-fluid across each breakpoint.
Read more >
Changing grid breakpoints doesnt work properly
I am trying to change grid breakpoints and container max width by means of creating ... in overrided variables but doesn`t override values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found