Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap4: Accessing variables?

I switched from Bootstrap 3 to Bootstrap 4. I am using sass sources which I compile on the run. When I changed the libraries, I started to get error on my media switches, i.e. for

@media screen and (min-width: $screen-md-min) {
    padding: 40px 50px;
}

I get error Undefined variable: "$screen-md-min".

What is a correct way to access variables of Bootstrap4?

Thank u.

like image 439
Very Curious Avatar asked Apr 05 '16 13:04

Very Curious


People also ask

What are Bootstrap variables and how to use them?

Bootstrap variables are storage locations paired with their associated symbolic names, which contain some known quantity of information referred to as values. To improve the writing of custom SCSS code in our package, from the MDB 4.5.2 version, there are three new files available, in which you can place various variables.

What is the difference between Bootstrap 4 and Bootstrap 5?

This tutorial follows Bootstrap 4, which was released in 2018, as an upgrade to Bootstrap 3, with new components, faster stylesheetc, more responsiveness, etc. Bootstrap 5 (released 2021) is the newest version of Bootstrap; It supports the latest, stable releases of all major browsers and platforms.

What is included in the Bootstrap 4 cheat sheet?

It includes code samples and live preview of elements. Bootstrap 4 Cheat Sheet - The ultimate list of Bootstrap classes Bootstrap 4 Cheat Sheet An interactive list of Bootstrap classes for version 4.3.1

Should you use a Bootstrap 4 Cdn for your website?

One advantage of using the Bootstrap 4 CDN: Many users already have downloaded Bootstrap 4 from MaxCDN when visiting another site. As a result, it will be loaded from cache when they visit your site, which leads to faster loading time.


1 Answers

See the relevant section of the Bootstrap 4 migration documentation.

The @screen-* variables have been replaced by the $grid-breakpoints variable along with the media-breakpoint-up(), media-breakpoint-down(), and media-breakpoint-only() helper Sass mixins.

Example usage:

@include media-breakpoint-up(md) {
    padding: 40px 50px;
}
like image 172
cvrebert Avatar answered Oct 06 '22 00:10

cvrebert