Skip to content

JoepGeevers/Responsive-Breakpoints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Responsive-Breakpoints

Library to bring bootstrap screen sizes xs sm md lg xl to your html elements class.

Problem

I need some padding to a specific element when bootstrap screen size is md

Solutions

  1. Use media query. But that means replicating pixels
  2. Use mixins. But that means recompiling bootstrap css
  3. Use Responsive-Breakpoints

Usage

<script src="responsive-breakpoints.js"></script>
<div class="responsive-breakpoints"></div>

This div will now automagically get bootstrap screensizes as classes:

<div class="responsive-breakpoints xs"></div>
<div class="responsive-breakpoints sm"></div>
<div class="responsive-breakpoints md"></div>
<div class="responsive-breakpoints lg"></div>
<div class="responsive-breakpoints xl"></div>

You can now style this element specifically:

div.md {
 padding-top: 4px;
}

Live example

https://codepen.io/HerasHackwork/pen/rGGNEK

About

Library to bring bootstrap screen sizes (xs sm md lg xl) to your html elements class.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors