Created
December 15, 2022 16:13
-
-
Save mistergraphx/bff74926d3edef2c500f3ad75d3601d0 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
// SETTINGS | |
$tiny-small: 360px !default; | |
$tiny-medium: 480px !default; | |
$tiny: 673px !default; // or 'em' if you prefer, of course | |
$small: 768px !default; | |
$medium: 1024px !default; | |
$large: 1200px !default; | |
$extra-large: 1350px !default; | |
// Colors | |
$grey3: grey; | |
// Additionnal "utility" breakpoints aliases | |
// ex. @include respond-to("medium-up") {...} | |
$bp-aliases: ( | |
'tiny-small' : (max-width: #{$tiny-small - 1}), | |
'tiny-medium' : (max-width: #{$tiny-medium - 1}), | |
'tiny' : (max-width: #{$tiny - 1}), | |
'small' : (max-width: #{$small - 1}), | |
'medium' : (max-width: #{$medium - 1}), | |
'large' : (max-width: #{$large - 1}), | |
'extra-large' : (max-width: #{$extra-large - 1}), | |
'tiny-small-up' : (min-width: #{$tiny-small}), | |
'tiny-medium-up' : (min-width: #{$tiny-medium}), | |
'tiny-up' : (min-width: #{$tiny}), | |
'small-up' : (min-width: #{$small}), | |
'medium-up' : (min-width: #{$medium}), | |
'large-up' : (min-width: #{$large}), | |
'extra-large-up' : (min-width: #{$extra-large}), | |
'retina' : (min-resolution: 2dppx) | |
); | |
// MIXINS | |
// Source : https://www.sitepoint.com/managing-responsive-breakpoints-sass/ | |
@mixin respond-to($name) { | |
// If the key exists in the map | |
@if map-has-key($bp-aliases, $name) { | |
// Prints a media query based on the value | |
@media #{inspect(map-get($bp-aliases, $name))} { | |
@content; | |
} | |
} | |
// If the key doesn't exist in the map | |
@else { | |
@warn "Unfortunately, no value could be retrieved from `#{$name}`. " | |
+ "Please make sure it is defined in `$bp-aliases` map."; | |
} | |
} | |
// OUTPUT | |
html{ | |
font-size: 62.5%; | |
box-sizing: border-box; | |
} | |
.container{ | |
max-width: 96rem; | |
margin: 0 auto; | |
//border: 1px solid red; | |
} | |
.headline{ | |
font-size: 3rem; | |
} | |
$lined-border-default: 1px solid black !default; | |
.lined{ | |
position: relative; | |
display: flex; | |
flex-wrap: nowrap; | |
align-items: center; | |
&:after, | |
&:before{ | |
content:''; | |
display: block; | |
height: 1px; | |
width: auto; | |
border-bottom: $lined-border-default; | |
} | |
} | |
.lined.lined--right:after, | |
.lined.lined--left:before{ | |
flex-grow: 1; | |
} | |
.lined[class$=--right]{ | |
&:after{ | |
margin-left: 2rem; | |
} | |
} | |
.lined[class$=--left]{ | |
&:before{ | |
margin-right: 2rem; | |
} | |
} | |
/* RESPONSIVE LINED */ | |
@each $bp in 'small-up','medium-up'{ | |
@include respond-to($bp){ | |
.lined.lined-#{$bp}--right::after, | |
.lined.lined-#{$bp}--left::before{ | |
flex-grow: 1; | |
} | |
} | |
} | |
/** | |
* Borders | |
* | |
* .border - border all | |
* .border-top - | |
* .border-bottom | |
* .border-[small-up|medium-up]-[top|bottom] | |
* | |
*/ | |
$border-color-default: $grey3 !default; | |
$border-width-default: 1px !default; | |
$border-color-default: #E5E5E5; | |
.border{ | |
border: $border-width-default solid $border-color-default; | |
&-bottom{ | |
border-bottom: $border-width-default solid $border-color-default; | |
} | |
&-top{ | |
border-top: $border-width-default solid $border-color-default; | |
} | |
} | |
@each $bp in 'small-up','medium-up'{ | |
@include respond-to($bp){ | |
.border-#{$bp}{ | |
border: $border-width-default solid $border-color-default; | |
} | |
@each $direction in 'top','bottom'{ | |
.border-#{$bp}-#{$direction}{ | |
border-#{$direction}: $border-width-default solid $border-color-default; | |
} | |
} | |
} | |
} | |
/* flex responsive utilities */ | |
$utilities: ( | |
'flex-wrap': ( | |
'prefix': 'flex', | |
'propertie': 'flex-wrap', | |
'values': 'wrap','nowrap', | |
'important': true, | |
'responsive': true | |
), | |
'flex-direction': ( | |
'prefix': 'flex', | |
'propertie': 'flex-direction', | |
'values': 'row','column', | |
'important': true, | |
'responsive': true | |
), | |
'justify-content': ( | |
'prefix': 'justify-content', | |
'propertie': 'justify-content', | |
'values': ( | |
'space-between':'between' | |
), | |
'important': true, | |
'responsive': true | |
), | |
); | |
@mixin make-utility($options){ | |
} | |
@each $utility,$options in $utilities{ | |
$prefix: if(map-get($options,'prefix'),map-get($options,'prefix')+'-',''); | |
$propertie: map-get($options,'propertie'); | |
$important: if(map-get($options,'important'),'!important',null); | |
@each $values in map-get($options,'values'){ | |
@if (type-of($values) == 'list'){ | |
@each $value in $values{ | |
.#{$prefix}#{$value}{ | |
#{$propertie}: #{$value} #{$important}; | |
} | |
} | |
} | |
} | |
} | |
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
html { | |
font-size: 62.5%; | |
box-sizing: border-box; | |
} | |
.container { | |
max-width: 96rem; | |
margin: 0 auto; | |
} | |
.headline { | |
font-size: 3rem; | |
} | |
.lined { | |
position: relative; | |
display: -webkit-box; | |
display: -webkit-flex; | |
display: -ms-flexbox; | |
display: flex; | |
-webkit-flex-wrap: nowrap; | |
-ms-flex-wrap: nowrap; | |
flex-wrap: nowrap; | |
-webkit-box-align: center; | |
-webkit-align-items: center; | |
-ms-flex-align: center; | |
align-items: center; | |
} | |
.lined:after, .lined:before { | |
content: ""; | |
display: block; | |
height: 1px; | |
width: auto; | |
border-bottom: 1px solid black; | |
} | |
.lined.lined--right:after, | |
.lined.lined--left:before { | |
-webkit-box-flex: 1; | |
-webkit-flex-grow: 1; | |
-ms-flex-positive: 1; | |
flex-grow: 1; | |
} | |
.lined[class$="--right"]:after { | |
margin-left: 2rem; | |
} | |
.lined[class$="--left"]:before { | |
margin-right: 2rem; | |
} | |
/* RESPONSIVE LINED */ | |
@media (min-width: 768px) { | |
.lined.lined-small-up--right::after, | |
.lined.lined-small-up--left::before { | |
-webkit-box-flex: 1; | |
-webkit-flex-grow: 1; | |
-ms-flex-positive: 1; | |
flex-grow: 1; | |
} | |
} | |
@media (min-width: 1024px) { | |
.lined.lined-medium-up--right::after, | |
.lined.lined-medium-up--left::before { | |
-webkit-box-flex: 1; | |
-webkit-flex-grow: 1; | |
-ms-flex-positive: 1; | |
flex-grow: 1; | |
} | |
} | |
/** | |
* Borders | |
* | |
* .border - border all | |
* .border-top - | |
* .border-bottom | |
* .border-[small-up|medium-up]-[top|bottom] | |
* | |
*/ | |
.border { | |
border: 1px solid #E5E5E5; | |
} | |
.border-bottom { | |
border-bottom: 1px solid #E5E5E5; | |
} | |
.border-top { | |
border-top: 1px solid #E5E5E5; | |
} | |
@media (min-width: 768px) { | |
.border-small-up { | |
border: 1px solid #E5E5E5; | |
} | |
.border-small-up-top { | |
border-top: 1px solid #E5E5E5; | |
} | |
.border-small-up-bottom { | |
border-bottom: 1px solid #E5E5E5; | |
} | |
} | |
@media (min-width: 1024px) { | |
.border-medium-up { | |
border: 1px solid #E5E5E5; | |
} | |
.border-medium-up-top { | |
border-top: 1px solid #E5E5E5; | |
} | |
.border-medium-up-bottom { | |
border-bottom: 1px solid #E5E5E5; | |
} | |
} | |
/* flex responsive utilities */ | |
@media (max-width: 767px) { | |
.flex-small-wrap { | |
-webkit-flex-wrap: wrap !important; | |
-ms-flex-wrap: wrap !important; | |
flex-wrap: wrap !important; | |
} | |
.flex-small-nowrap { | |
-webkit-flex-wrap: nowrap !important; | |
-ms-flex-wrap: nowrap !important; | |
flex-wrap: nowrap !important; | |
} | |
} | |
@media (min-width: 768px) { | |
.flex-small-up-wrap { | |
-webkit-flex-wrap: wrap !important; | |
-ms-flex-wrap: wrap !important; | |
flex-wrap: wrap !important; | |
} | |
.flex-small-up-nowrap { | |
-webkit-flex-wrap: nowrap !important; | |
-ms-flex-wrap: nowrap !important; | |
flex-wrap: nowrap !important; | |
} | |
} | |
@media (max-width: 767px) { | |
.flex-small-row { | |
-webkit-box-orient: horizontal !important; | |
-webkit-box-direction: normal !important; | |
-webkit-flex-direction: row !important; | |
-ms-flex-direction: row !important; | |
flex-direction: row !important; | |
} | |
.flex-small-column { | |
-webkit-box-orient: vertical !important; | |
-webkit-box-direction: normal !important; | |
-webkit-flex-direction: column !important; | |
-ms-flex-direction: column !important; | |
flex-direction: column !important; | |
} | |
} | |
@media (min-width: 768px) { | |
.flex-small-up-row { | |
-webkit-box-orient: horizontal !important; | |
-webkit-box-direction: normal !important; | |
-webkit-flex-direction: row !important; | |
-ms-flex-direction: row !important; | |
flex-direction: row !important; | |
} | |
.flex-small-up-column { | |
-webkit-box-orient: vertical !important; | |
-webkit-box-direction: normal !important; | |
-webkit-flex-direction: column !important; | |
-ms-flex-direction: column !important; | |
flex-direction: column !important; | |
} | |
} | |
.justify-content-space-between between { | |
-webkit-box-pack: space-between between !important; | |
-webkit-justify-content: space-between between !important; | |
-ms-flex-pack: space-between between !important; | |
justify-content: space-between between !important; | |
} | |
@media (max-width: 767px) { | |
.justify-content-small-space-between between { | |
-webkit-box-pack: space-between between !important; | |
-webkit-justify-content: space-between between !important; | |
-ms-flex-pack: space-between between !important; | |
justify-content: space-between between !important; | |
} | |
} | |
@media (min-width: 768px) { | |
.justify-content-small-up-space-between between { | |
-webkit-box-pack: space-between between !important; | |
-webkit-justify-content: space-between between !important; | |
-ms-flex-pack: space-between between !important; | |
justify-content: space-between between !important; | |
} | |
} |
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": "dart-sass/1.32.12", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment