Skip to content

Instantly share code, notes, and snippets.

@mborsare
Created August 6, 2014 20:59
Show Gist options
  • Save mborsare/cfef679b4a9e81d6d348 to your computer and use it in GitHub Desktop.
Save mborsare/cfef679b4a9e81d6d348 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.0.rc.1)
// ----
// The Mixin
////////////////////////////////////////////////////////////////////////////
@mixin comprehension-highlight($content-type, $element-type) {
$comprehensions: weak, fair, strong;
@if $element-type == "table" {
#{$content-type} {
@each $comprehension in $comprehensions {
&.#{$comprehension} {
#{$element-type} {
box-shadow: inset 0 0 0 10px $comprehension;
}
}
}
}
}
@else if $element-type == "figure" {
#{$content-type} {
@each $comprehension in $comprehensions {
&.#{$comprehension} {
#{$element-type} {
box-shadow: inset 0 0 0 10px $comprehension;
}
}
}
}
}
}
// In Use
////////////////////////////////////////////////////////////////////////////
@include comprehension-highlight (text, figure);
@include comprehension-highlight (text, table);
text.weak figure {
box-shadow: inset 0 0 0 10px weak;
}
text.fair figure {
box-shadow: inset 0 0 0 10px fair;
}
text.strong figure {
box-shadow: inset 0 0 0 10px strong;
}
text.weak table {
box-shadow: inset 0 0 0 10px weak;
}
text.fair table {
box-shadow: inset 0 0 0 10px fair;
}
text.strong table {
box-shadow: inset 0 0 0 10px strong;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment