Last active
November 19, 2019 15:44
-
-
Save fabd/9ccc57222593c20c0f9832404add7016 to your computer and use it in GitHub Desktop.
SASS creating utilities and ESCAPING special chars in class name
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
// Add some sizes to tailwind text-* utilities | |
// | |
// Outputs eg: | |
// | |
// .text-3\.5 { | |
// font-size: 3.5rem; | |
// } | |
$textExtraSizes: (('2' 2), ('3\\.5' 3.5), ('4\\.3', 4.3)); | |
@each $size in $textExtraSizes { | |
.text-#{nth($size, 1)} { | |
font-size: #{nth($size, 2)}rem; | |
} | |
} | |
// min-width utilities | |
$minWidthSizes: (165 200); | |
@each $size in $minWidthSizes { | |
.ux-minWidth#{$size} { | |
min-width: #{$size}px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment