Last active
December 1, 2016 13:59
-
-
Save Bamieh/912a6f0b63cbb53f3ad0bd8df7171c6a to your computer and use it in GitHub Desktop.
Sass parse class without dot (strip dot "." from class name)
This file contains hidden or 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 parse-dotless($class) { | |
$this: quote($class); | |
@return if(str-slice($this, 0, 1) == ".", str-slice($this, 2, str-length($this)), $this); | |
} | |
/* | |
example usage: | |
.14px { | |
font-size: parse-dotless(#{&}); // will strip the class from .14px to return 14px; | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment