Skip to content

Instantly share code, notes, and snippets.

@jdsteinbach
Created May 2, 2014 18:18
Show Gist options
  • Select an option

  • Save jdsteinbach/11482335 to your computer and use it in GitHub Desktop.

Select an option

Save jdsteinbach/11482335 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.6)
// Compass (v1.0.0.alpha.18)
// ----
/* Here's my mixin, but it will repeat itself too much for my taste: */
@mixin grid() {
width: 100%;
&-item{
width: 33%;
padding: 1em;
}
}
.products {
@include grid();
}
.services {
@include grid();
}
/* Ah, here's a better way to use the mixin.
Only problem is I have to use put all my parent classes in the same place. */
.products,
.services {
@include grid();
}
/* Here's my mixin, but it will repeat itself too much for my taste: */
.products {
width: 100%;
}
.products-item {
width: 33%;
padding: 1em;
}
.services {
width: 100%;
}
.services-item {
width: 33%;
padding: 1em;
}
/* Ah, here's a better way to use the mixin.
Only problem is I have to use put all my parent classes in the same place. */
.products,
.services {
width: 100%;
}
.products-item,
.services-item {
width: 33%;
padding: 1em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment