Skip to content

Instantly share code, notes, and snippets.

@mazhar266
Last active August 1, 2017 11:42
Show Gist options
  • Save mazhar266/8915879 to your computer and use it in GitHub Desktop.
Save mazhar266/8915879 to your computer and use it in GitHub Desktop.
Media Query as Bootstrap
@media(max-width:767px){}
@media(min-width:768px){}
@media(min-width:992px){}
@media(min-width:1200px){}
// init -- for own taste
// rename desktop as laptop
$screen-laptop : $screen-desktop;
// rename large screen as desktop
$screen-desktop : $screen-lg-desktop;
// specially for the smart watches
$screen-mobile : 320px;
// normal mobile css first
@media(min-width:$screen-tablet){
// tablet code here
}
@media(min-width:$screen-laptop){
// laptop screen / desktop code here
}
@media(min-width:$screen-desktop){
// large screen / desktop code here
}
// new way
// @media (max-width: 767px) {
@include media-breakpoint-down(sm) {}
/* showing the mobile menu */
@media (max-width: 1070px) {
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin: 7.5px -15px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment