Skip to content

Instantly share code, notes, and snippets.

@fabd
Last active November 19, 2019 15:44
Show Gist options
  • Save fabd/9ccc57222593c20c0f9832404add7016 to your computer and use it in GitHub Desktop.
Save fabd/9ccc57222593c20c0f9832404add7016 to your computer and use it in GitHub Desktop.
SASS creating utilities and ESCAPING special chars in class name
// 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