Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Bamieh
Last active December 1, 2016 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bamieh/912a6f0b63cbb53f3ad0bd8df7171c6a to your computer and use it in GitHub Desktop.
Save Bamieh/912a6f0b63cbb53f3ad0bd8df7171c6a to your computer and use it in GitHub Desktop.
Sass parse class without dot (strip dot "." from class name)
@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