Skip to content

Instantly share code, notes, and snippets.

@iRoachie
Created September 14, 2016 17:35
Show Gist options
  • Save iRoachie/4cd2a8d32b0891cf8ec0fe6096d1992e to your computer and use it in GitHub Desktop.
Save iRoachie/4cd2a8d32b0891cf8ec0fe6096d1992e to your computer and use it in GitHub Desktop.
Mixins
@import 'vars';
@mixin element($element) {
&__#{$element} {
@content;
}
}
@mixin modifier($element) {
&--#{$element} {
@content;
}
}
@mixin size($width, $height: $width) {
width: $width;
height: $height;
}
@mixin min-size($width, $height: $width) {
min-width: $width;
min-height: $height;
}
@mixin max-size($width, $height: $width) {
max-width: $width;
max-height: $height;
}
@mixin position($position, $top: null, $right: null, $bottom: null, $left: null) {
position: $position;
top: $top;
right: $right;
bottom: $bottom;
left: $left;
}
@mixin border($top: null, $right: null, $bottom: null, $left: null) {
border-top: $top;
border-right: $right;
border-bottom: $bottom;
border-left: $left;
}
@mixin breakpoint($breakpoint) {
@media (max-width: map_get($breakpoints, $breakpoint)) {
@content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment