Created
September 1, 2014 13:33
-
-
Save chao-xian/3565151f3e61dde70c3e to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.1) | |
// ---- | |
$color: blue; | |
$tablet: 768px; | |
@mixin border-radius($radii) { | |
border-radius: $radii; | |
} | |
@mixin mq($viewport) { | |
@media (min-width: $viewport) { | |
@content; | |
} | |
} | |
%cf { | |
&:before, | |
&:after { | |
content: " "; | |
display: table; | |
} | |
&:after { | |
clear: both; | |
} | |
*zoom: 1; | |
} | |
.element { | |
$color: #C3C3C3; // Class specific variables | |
@extend %cf; // Followed by extends | |
@include border-radius(5px); // Then mixins | |
// Then any needed CSS | |
color: $color; | |
padding: 1em 2.4%; | |
&:hover { | |
background-color: white; // pseudo elements | |
} | |
.box { // any child elements | |
background-color: orange; | |
} | |
.thing & { // contextual overides | |
padding: 2em 2.4%; | |
} | |
@include mq(tablet) { // media queries last | |
padding: 0.5em 0; | |
.box { | |
background-color: red; | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.element { | |
*zoom: 1; | |
} | |
.element:before, .element:after { | |
content: " "; | |
display: table; | |
} | |
.element:after { | |
clear: both; | |
} | |
.element { | |
border-radius: 5px; | |
color: #c3c3c3; | |
padding: 1em 2.4%; | |
} | |
.element:hover { | |
background-color: white; | |
} | |
.element .box { | |
background-color: orange; | |
} | |
.thing .element { | |
padding: 2em 2.4%; | |
} | |
@media (min-width: tablet) { | |
.element { | |
padding: 0.5em 0; | |
} | |
.element .box { | |
background-color: red; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment