Created
February 10, 2022 00:31
-
-
Save SvenBudak/339a33db0c1d2cadc5ed32d33bb0c8e6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
$breakpoints: ('xs': 0, 'sm': 600px) !default; | |
@mixin media-min($var) {@media only screen and (min-width: $var) {@content;}} | |
@mixin media-max($var) {@media only screen and (max-width: $var - 1px) {@content;}} | |
@mixin media-from-to($var1, $var2) {@media only screen and (min-width: $var1) and (max-width: $var2 - 1px) {@content;}} | |
$spacings: ( | |
'margin': ( | |
'shorten-class-names': false, | |
'directions': ('top', 'right', 'bottom', 'left'), | |
'spacings': ('4px', '8px'), | |
'no-classes': true, | |
'no-min-classes': false, | |
'no-max-classes': false, | |
'no-from-to-classes': true, | |
'base-classes': false, | |
'base-min-classes': false, | |
'base-max-classes': false, | |
'base-from-to-classes': false, | |
) | |
); | |
@each $variants, $variantObject in $spacings { | |
@each $type in $variants { | |
// No Classes | |
@if map-get($variantObject, 'no-classes') { | |
.no-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($type, 0, 1), $type)} { | |
#{$type}: 0 !important; | |
} | |
@if map-get($variantObject, 'directions') { | |
@each $direction in map-get($variantObject, 'directions') { | |
.no-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($type, 0, 1), $type)}-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($direction, 0, 1), $direction)} { | |
#{$type}-#{$direction}: 0 !important; | |
} | |
} | |
} | |
} | |
// No Min Classes | |
@if map-get($variantObject, 'no-min-classes') { | |
@each $breakpoint, $res in $breakpoints { | |
@include media-min($res) { | |
.no-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($type, 0, 1), $type)}-min-#{$breakpoint} { | |
#{$type}: 0 !important; | |
} | |
@if map-get($variantObject, 'directions') { | |
@each $direction in map-get($variantObject, 'directions') { | |
.no-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($type, 0, 1), $type)}-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($direction, 0, 1), $direction)}-min-#{$breakpoint} { | |
#{$type}-#{$direction}: 0 !important; | |
} | |
} | |
} | |
} | |
} | |
} | |
// No Max Classes | |
@if map-get($variantObject, 'no-max-classes') { | |
@each $breakpoint, $res in $breakpoints { | |
@include media-max($res) { | |
.no-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($type, 0, 1), $type)}-max-#{$breakpoint} { | |
#{$type}: 0 !important; | |
} | |
@if map-get($variantObject, 'directions') { | |
@each $direction in map-get($variantObject, 'directions') { | |
.no-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($type, 0, 1), $type)}-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($direction, 0, 1), $direction)}-max-#{$breakpoint} { | |
#{$type}-#{$direction}: 0 !important; | |
} | |
} | |
} | |
} | |
} | |
} | |
// No From > To Classes | |
@if map-get($variantObject, 'no-max-classes') { | |
@each $breakpoint, $res in $breakpoints { | |
@include media-from-to($res) { | |
.no-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($type, 0, 1), $type)}-from-to-#{$breakpoint} { | |
#{$type}: 0 !important; | |
} | |
@if map-get($variantObject, 'directions') { | |
@each $direction in map-get($variantObject, 'directions') { | |
.no-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($type, 0, 1), $type)}-#{if(map-get($variantObject, 'shorten-class-names'), str-slice($direction, 0, 1), $direction)}-from-to-#{$breakpoint} { | |
#{$type}-#{$direction}: 0 !important; | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
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
.no-margin { | |
margin: 0 !important; | |
} | |
.no-margin-top { | |
margin-top: 0 !important; | |
} | |
.no-margin-right { | |
margin-right: 0 !important; | |
} | |
.no-margin-bottom { | |
margin-bottom: 0 !important; | |
} | |
.no-margin-left { | |
margin-left: 0 !important; | |
} |
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
{ | |
"sass": { | |
"compiler": "dart-sass/1.32.12", | |
"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