-1

I have 2 questions: 1. What the $container-max-width Bootstrap variable is used for? 2. How should I override the variables if I need the following resolutions?

 sm: 0px -> 768px - tablet portrait
 md: 769px -> 1442px - tablet landscape and laptop
 lg: 1443px -> 1920px - large screens
xyzz
  • 21
  • 1
  • 7

2 Answers2

0

Just import your variables before bootstrap import, because those variables are define with !default flag, so when your scss will be transforming to css it will use your override values.

$grid-breakpoints: (
  xs: 0,
  sm: 0,
  md: 769px,
  lg: 1443px,
  xl: 1921px
);

$container-max-widths: (
  sm: 540px,
  md: 720px,
  lg: 960px,
  xl: 1140px
) !default;

@import 'bootstrap'
0

You just need to override $grid-breakpoints and $container-max-widths. Write these codes before where you import bootstrap.

Grid break-points

// Define the minimum dimensions at which your layout will change,
// adapting to different screen sizes, for use in media queries.

$grid-breakpoints: (
        sm: 0,
        md: 769px,
        lg: 1443px,
) !default;

Grid containers

// Define the maximum width of `.container` for different screen sizes.

$container-max-widths: (
        sm: 768px,
        md: 1442px,
        lg: 1920px,
) !default;
mahan
  • 12,366
  • 5
  • 48
  • 83