Skip to content

Instantly share code, notes, and snippets.

@eightdotthree
Forked from nessthehero/mixins.scss
Last active December 23, 2015 00:39
Show Gist options
  • Save eightdotthree/6555523 to your computer and use it in GitHub Desktop.
Save eightdotthree/6555523 to your computer and use it in GitHub Desktop.
@mixin bp($point) {
@if $point == print {
@media only print { @content; }
}
}
@mixin em_width($px) { width: #{$px / 16}em; }
@mixin em_maxwidth($px) { max-width: #{$px / 16}em; }
@mixin em_minwidth($px) { min-width: #{$px / 16}em; }
@mixin em_maxheight($px) { max-height: #{$px / 16}em; }
@mixin em_minheight($px) { min-height: #{$px / 16}em; }
@mixin em_margin($top:0,$right:0,$bot:0,$left:0) { margin: #{$top / 16}em #{$right / 16}em #{$bot / 16}em #{$left / 16}em }
@mixin em_padding($top:0,$right:0,$bot:0,$left:0) { padding: #{$top / 16}em #{$right / 16}em #{$bot / 16}em #{$left / 16}em }
@mixin em_fontsize($px) { font-size: #{$px / 16}em; }
// My setup for sprites
@import "../img/*.png";
@include all-img-sprites;
$sprites: logo_header cats;
@mixin sprite-dimensions($name) {
width: img-sprite-width($name);
height: img-sprite-height($name);
}
.sprite {
display: inline-block;
background-color: transparent;
}
@each $sprite in $sprites {
.#{$sprite} {
@include img-sprite($sprite);
@include sprite-dimensions($sprite);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment