Created
April 6, 2020 03:22
-
-
Save nelson6e65/85610035751af719fb355431b35ff5bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function dasherize($string) { | |
$progress: str-slice($string, 2); | |
$result: str-slice($string, 1, 1); | |
@while str-length($progress) > 0 { | |
$char: str-slice($progress, 1, 1); | |
$mayus: to-upper-case($char); | |
@if ($char == $mayus) { | |
$result: $result + "-" + $char; | |
} | |
@else { | |
$result: $result + $char; | |
} | |
$progress: str-slice($progress, 2); | |
} | |
@return to-lower-case($result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.sassmeister.com/