Skip to content

Instantly share code, notes, and snippets.

@isaacdanielanderson
Created September 12, 2018 05:34
Show Gist options
  • Save isaacdanielanderson/40f6b85a312e36cc32bc7435f4013505 to your computer and use it in GitHub Desktop.
Save isaacdanielanderson/40f6b85a312e36cc32bc7435f4013505 to your computer and use it in GitHub Desktop.
postcss-mixins Bootstrap Breakpoint Media Queries
/* Boostrap 4.1.3 breakpoints for page widths */
/* Extra small devices (portrait phones, less than 576px)
* No media query since this is the default in Bootstrap
*
* postcss-mixins: https://www.npmjs.com/package/postcss-mixins
*/
/* Small devices (landscape phones, 576px and up) */
@define-mixin sm_up {
@media (min-width: 576px) {
@mixin-content;
}
}
/* Medium devices (tablets, 768px and up) */
@define-mixin md_up {
@media (min-width: 768px) {
@mixin-content;
}
}
/* Large devices (desktops, 992px and up) */
@define-mixin lg_up {
@media (min-width: 992px) {
@mixin-content;
}
}
/* Extra large devices (large desktops, 1200px and up) */
@define-mixin xl_up {
@media (min-width: 1200px) {
@mixin-content;
}
}
/*
EXAMPLE USAGE:
.test-mixin {
@mixin lg_up {
font-size: 100px;
}
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment