Skip to content

Instantly share code, notes, and snippets.

@trub
Created April 8, 2014 21:42
Show Gist options
  • Select an option

  • Save trub/10197321 to your computer and use it in GitHub Desktop.

Select an option

Save trub/10197321 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<span class="inset-one">ello</span>
<span class="inset-two">arry</span>
<span class="inset-3">potter</span>
// ----
// libsass (v0.7.0)
// ----
@mixin text-inset($color, $opacity: 0.5) {
$shadow-color: desaturate(invert($color), 100%);
@mixin lightness {
content: 'lightness' ;
font-size: .5em;
display:block;
}
@if lightness($color) < 50% {
text-shadow: 1px 1px 1px rgba($color, $opacity);
&:after {
@include lightness;
}
} @else {
text-shadow: 1px 1px 1px rgba($color, $opacity);
&:after {
@include lightness;
}
}
color: $color;
}
body {
background-color: #999;
font-size: 6em;
padding: .1em;
}
%inset {
font-weight:bold;
text-transform: uppercase;
display: block;
}
.inset-one {
@extend %inset;
@include text-inset(pink)
}
.inset-two {
@extend %inset;
@include text-inset(green)
}
.inset-3 {
@extend %inset;
@include desaturate(orange)
}
source string:49: error: no mixin named desaturate
Backtrace:
source string:49
<span class="inset-one">ello</span>
<span class="inset-two">arry</span>
<span class="inset-3">potter</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment