Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
=rotated-text($num-letters: 100, $angle-span: 180deg, $angle-offset: 0deg)
$angle-per-char: $angle-span / $num-letters;
@for $i from 1 through $num-letters
+transform(rotate($angle-offset + $angle-per-char * $i))


Just a quick heads up: this is listed as an .scss, while it's closer to validating as .sass if you remove the semicolon in lin e 2. Otherwise it's missing some curly brackets, etc.

For future reference, this is what the .scss version would look like:

@mixin rotated-text($num-letters: 100, $angle-span: 180deg, $angle-offset: 0deg) {
$angle-per-char: $angle-span / $num-letters;
@for $i from 1 through $num-letters {
.char#{$i} {
@include transform(rotate($angle-offset + $angle-per-char * $i))

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