Skip to content

Instantly share code, notes, and snippets.

@shaunbent
Created April 17, 2014 13:56
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 shaunbent/10985356 to your computer and use it in GitHub Desktop.
Save shaunbent/10985356 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.5)
// Compass (v1.0.0.alpha.18)
// ----
$enhanced: true !default;
@mixin mq($from: false, $to: false) {
@media screen and (min-width: #{$from}) {
@content;
}
}
@mixin extend($name: '', $breakpoint: '') {
@if $breakpoint == '' {
%#{$name} {
@include border;
}
@extend %#{$name};
} @else {
@include mq($from: $breakpoint) {
%#{$name}--compact {
@include border;
}
@extend %#{$name}--compact;
}
}
@content;
}
@mixin border {
border: 1px solid blue;
}
@include mq($from: compact) {
%border-compact {
border: 1px solid red;
}
}
.box {
color: red;
@if $enhanced {
//@include extend(border);
font-weight: bold;
@include mq($from: compact) {
@include extend(border, compact);
color: blue;
}
@include mq($from: medium) {
color: green;
}
}
}
.box {
color: red;
font-weight: bold;
}
@media screen and (min-width: compact) {
.box {
color: blue;
}
}
@media screen and (min-width: compact) and (min-width: compact) {
.box .box {
border: 1px solid blue;
}
}
@media screen and (min-width: medium) {
.box {
color: green;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment