Skip to content

Instantly share code, notes, and snippets.

@liamness
Last active August 29, 2015 14:11
Show Gist options
  • Save liamness/0b8c1a0e72481e8f7297 to your computer and use it in GitHub Desktop.
Save liamness/0b8c1a0e72481e8f7297 to your computer and use it in GitHub Desktop.
because -webkit-text-stroke is never going to blossom into text-stroke
// because -webkit-text-stroke is never going to blossom into text-stroke
@mixin text-outline($width: 1px, $color: #000, $blur: 0) {
@if (not unitless($width)) and (unit($width) != 'px') {
@warn '$width should be unitless or in pixels';
} @else if $width < 1px {
@warn '$width should be positive';
} @else if $width > 10px {
@warn '$width should be 10px or less to avoid long compilation times and bloated css';
}
$shadows: ();
@for $x from -$width through $width {
@for $y from -$width through $width {
@if $x != 0 or $y != 0 {
$shadows: append($shadows, #{$x}px #{$y}px $blur $color, comma);
}
}
}
text-shadow: $shadows;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment