Skip to content

Instantly share code, notes, and snippets.

@ltackett
Created October 28, 2011 19:24
Show Gist options
  • Save ltackett/1323223 to your computer and use it in GitHub Desktop.
Save ltackett/1323223 to your computer and use it in GitHub Desktop.
Evented Sass
/* === source: === */
@mixin some-mixin {
overflow: hidden;
width: 200px;
@trigger "callback"; /* Trigger an event */
}
.box {
@include some-mixin; /* Call the mixin */
@bind "callback" { overflow: visible; } /* Use the triggered event to override something. */
}
/* === output: === */
.box {
width: 200px;
overflow: visible; /* No wasteful output. */
}
/* === source: === */
@mixin some-mixin {
overflow: hidden;
width: 200px;
@trigger "callback"; /* Trigger an event */
}
.box {
@include some-mixin; /* Call the mixin */
@bind "callback" { margin: 0 auto; } /* Use the triggered event to extend something. */
}
/* === output: === */
.box {
overflow: hidden;
width: 200px;
margin: 0 auto; /* Extended output. */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment