Skip to content

Instantly share code, notes, and snippets.

@haggen
Last active April 26, 2023 05:35
Show Gist options
  • Save haggen/4649531d084f56fd877e to your computer and use it in GitHub Desktop.
Save haggen/4649531d084f56fd877e to your computer and use it in GitHub Desktop.
Text stroke using text-shadow as SCSS mixin.
/**
* Text stroke using text-shadow.
* @example
* p {
* @include stroke(black, 2px);
* }
*/
@mixin stroke($color, $size: 1px) {
$value: null;
@for $x from $size * -1 through $size {
@for $y from $size * -1 through $size {
@if not ($x == 0px and $y == 0px) {
$value: $value, $x $y $color;
}
}
}
text-shadow: $value;
}
@haggen
Copy link
Author

haggen commented Sep 20, 2022

@AndreKelling Thanks! I just edited it with your feedback. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment