Skip to content

Instantly share code, notes, and snippets.

@ohiosveryown
Last active November 5, 2018 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohiosveryown/d34f0da98feac7282a4a08e4c875fbca to your computer and use it in GitHub Desktop.
Save ohiosveryown/d34f0da98feac7282a4a08e4c875fbca to your computer and use it in GitHub Desktop.
Grid & System Font Stack mainly for codepen imports
// System Font Stack
$system-font: -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
// Gird
$columns: 12;
$gutter: 2%;
@function grid-width($cols, $has-gutter:false) {
@if $has-gutter {
@return calc(((100% / #{$columns}) * #{$cols}) - #{$gutter});
}
@else {
@return calc((100% / #{$columns}) * #{$cols});
}
}
// mixins – media queries
/*==========
df - 0-359
xs - 360
sm - 400
md - 700
mdl - 1000
lg - 1200
xl - 1500
===========*/
@mixin breakpoint($class) {
@if $class == xs {
@media (min-width: 360px) { @content; }
}
@if $class == sm {
@media (min-width: 400px) { @content; }
}
@else if $class == md {
@media (min-width: 700px) { @content; }
}
@else if $class == mdl {
@media (min-width: 1000px) { @content; }
}
@else if $class == lg {
@media (min-width: 1200px) { @content; }
}
@else if $class == xl {
@media (min-width: 1500px) { @content; }
}
@else {
@warn "Breakpoint mixin supports: xs, sm, md, mdl, lg, xl";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment