Skip to content

Instantly share code, notes, and snippets.

@chao-xian
Created September 1, 2014 13:33
Show Gist options
  • Save chao-xian/3565151f3e61dde70c3e to your computer and use it in GitHub Desktop.
Save chao-xian/3565151f3e61dde70c3e to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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;
}
}
}
.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