Skip to content

Instantly share code, notes, and snippets.

@camerond
Last active December 31, 2015 18:59
Show Gist options
  • Save camerond/8030122 to your computer and use it in GitHub Desktop.
Save camerond/8030122 to your computer and use it in GitHub Desktop.
// cask.sass
// simple responsive mixins
$site-width-max: 1400px !default
$site-width-mid: 800px !default
$site-width-narrow: 480px !default
= min-width($width)
@media screen and (min-width: #{$width})
@content
= max-width($width)
@media screen and (max-width: #{$width})
@content
= tablet
+max-width($site-width-mid)
@content
= mobile
+max-width($site-width-narrow)
@content
= print
@media print
@content
= hide-print
@media print
display: none !important
= responsive($attr, $full, $mid:false, $narrow:false)
#{$attr}: #{$full}
@if $mid
+max-width($site-width-mid)
#{$attr}: #{$mid}
@if $narrow
+max-width($site-width-narrow)
#{$attr}: #{$narrow}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment