Created
May 16, 2020 17:03
-
-
Save eric-mathison/d761c112d7308bf1f907f2cd92431d4b to your computer and use it in GitHub Desktop.
SASS helper for adding opacity classes
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
// Base opacity to start with | |
$base: 0; | |
@while $base < 1 { | |
$base: $base + 0.05; | |
.o-#{$base * 100} { | |
opacity: #{$base}; | |
} | |
} |
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
// Auto generated CSS from above script | |
.o-5 { | |
opacity: 0.05; | |
} | |
.o-10 { | |
opacity: 0.1; | |
} | |
.o-15 { | |
opacity: 0.15; | |
} | |
.o-20 { | |
opacity: 0.2; | |
} | |
.o-25 { | |
opacity: 0.25; | |
} | |
.o-30 { | |
opacity: 0.3; | |
} | |
.o-35 { | |
opacity: 0.35; | |
} | |
.o-40 { | |
opacity: 0.4; | |
} | |
.o-45 { | |
opacity: 0.45; | |
} | |
.o-50 { | |
opacity: 0.5; | |
} | |
.o-55 { | |
opacity: 0.55; | |
} | |
.o-60 { | |
opacity: 0.6; | |
} | |
.o-65 { | |
opacity: 0.65; | |
} | |
.o-70 { | |
opacity: 0.7; | |
} | |
.o-75 { | |
opacity: 0.75; | |
} | |
.o-80 { | |
opacity: 0.8; | |
} | |
.o-85 { | |
opacity: 0.85; | |
} | |
.o-90 { | |
opacity: 0.9; | |
} | |
.o-95 { | |
opacity: 0.95; | |
} | |
.o-100 { | |
opacity: 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment