Created
November 5, 2020 15:17
-
-
Save JoeCianflone/887bc06107f07d60bc342454f37180c7 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
| $mq: ("xs": #{"min-width: 480px"}); | |
| @mixin at-size($size) { | |
| &\:#{$size} { | |
| @content; | |
| } | |
| } | |
| @mixin for-variant($parent) { | |
| &\:#{$parent} { | |
| @content; | |
| @include size-lists { | |
| @content; | |
| } | |
| } | |
| } | |
| @mixin with-queries($parent: &) { | |
| $first: true; | |
| @if $first == true { | |
| @content; | |
| $first: false; | |
| } | |
| @each $key, $value in $mq { | |
| $name: str-slice(#{$parent}, 2); | |
| @media ($value) { | |
| @at-root .#{$key}\:\:#{$name} { | |
| @content; | |
| } | |
| } | |
| } | |
| } | |
| @mixin sizes-and-variants { | |
| @content; | |
| @include size-lists { | |
| @content; | |
| } | |
| @include variant-lists { | |
| @content; | |
| } | |
| } | |
| // ---------------------------------------------------------------------------- | |
| @mixin size-lists { | |
| @include at-size("xsmall") { | |
| @content; | |
| font-size: 12px; | |
| } | |
| } | |
| @mixin variant-lists { | |
| @include for-variant("block") { | |
| @content; | |
| display: block; | |
| } | |
| } | |
| // ----------------------------------------------------------------------------- | |
| @mixin btn { | |
| font-size: 20px; | |
| display: flex; | |
| } | |
| .button { | |
| @include with-queries { | |
| @include sizes-and-variants { | |
| @include btn; | |
| } | |
| } | |
| } | |
| .button--secondary { | |
| @include with-queries { | |
| @include sizes-and-variants { | |
| @include btn; | |
| &:hover { | |
| background: red; | |
| } | |
| } | |
| } | |
| } |
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
| <center> | |
| <br> | |
| <a href="#" class="button:block:xsmall">Button</a> | |
| <a href="#" class="button--secondary:block">Button</a> | |
| </center> |
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
| .button { | |
| font-size: 20px; | |
| display: flex; | |
| } | |
| .button\:xsmall { | |
| font-size: 20px; | |
| display: flex; | |
| font-size: 12px; | |
| } | |
| .button\:block { | |
| font-size: 20px; | |
| display: flex; | |
| display: block; | |
| } | |
| .button\:block\:xsmall { | |
| font-size: 20px; | |
| display: flex; | |
| display: block; | |
| font-size: 12px; | |
| } | |
| @media (min-width: 480px) { | |
| .xs\:\:button { | |
| font-size: 20px; | |
| display: flex; | |
| } | |
| .xs\:\:button\:xsmall { | |
| font-size: 20px; | |
| display: flex; | |
| font-size: 12px; | |
| } | |
| .xs\:\:button\:block { | |
| font-size: 20px; | |
| display: flex; | |
| display: block; | |
| } | |
| .xs\:\:button\:block\:xsmall { | |
| font-size: 20px; | |
| display: flex; | |
| display: block; | |
| font-size: 12px; | |
| } | |
| } | |
| .button--secondary { | |
| font-size: 20px; | |
| display: flex; | |
| } | |
| .button--secondary:hover { | |
| background: red; | |
| } | |
| .button--secondary\:xsmall { | |
| font-size: 20px; | |
| display: flex; | |
| font-size: 12px; | |
| } | |
| .button--secondary\:xsmall:hover { | |
| background: red; | |
| } | |
| .button--secondary\:block { | |
| font-size: 20px; | |
| display: flex; | |
| display: block; | |
| } | |
| .button--secondary\:block:hover { | |
| background: red; | |
| } | |
| .button--secondary\:block\:xsmall { | |
| font-size: 20px; | |
| display: flex; | |
| display: block; | |
| font-size: 12px; | |
| } | |
| .button--secondary\:block\:xsmall:hover { | |
| background: red; | |
| } | |
| @media (min-width: 480px) { | |
| .xs\:\:button--secondary { | |
| font-size: 20px; | |
| display: flex; | |
| } | |
| .xs\:\:button--secondary:hover { | |
| background: red; | |
| } | |
| .xs\:\:button--secondary\:xsmall { | |
| font-size: 20px; | |
| display: flex; | |
| font-size: 12px; | |
| } | |
| .xs\:\:button--secondary\:xsmall:hover { | |
| background: red; | |
| } | |
| .xs\:\:button--secondary\:block { | |
| font-size: 20px; | |
| display: flex; | |
| display: block; | |
| } | |
| .xs\:\:button--secondary\:block:hover { | |
| background: red; | |
| } | |
| .xs\:\:button--secondary\:block\:xsmall { | |
| font-size: 20px; | |
| display: flex; | |
| display: block; | |
| font-size: 12px; | |
| } | |
| .xs\:\:button--secondary\:block\:xsmall:hover { | |
| background: red; | |
| } | |
| } |
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
| { | |
| "sass": { | |
| "compiler": "libsass/3.5.5", | |
| "extensions": {}, | |
| "syntax": "SCSS", | |
| "outputStyle": "expanded" | |
| }, | |
| "autoprefixer": false | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment