Created
March 12, 2021 19:43
-
-
Save LucasLevino/807659e07e5d0c1167754643b5bc239c 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
@mixin clearfix { | |
&::after, &::before { | |
content: ''; | |
display: table; | |
clear: both; | |
} | |
} | |
@mixin container { | |
width: 100%; /* 1 */ | |
max-width: 1024px; /* 1 */ | |
margin-left: auto; /* 2 */ | |
margin-right: auto; /* 2 */ | |
padding-left: calc($gutter / 2);/* 3 */ | |
padding-right: 20px; /* 3 */ | |
@include clearfix; | |
} | |
.container { | |
display: flex; | |
@include container; | |
@supports (display: grid) { | |
display: grid; | |
} | |
} | |
@mixin row { | |
display: grid; | |
grid-template-columns: repeat(6, 1fr); | |
grid-template-rows: auto; | |
gap: 24px; | |
} | |
.row { | |
@include row; | |
@supports not (display: grid) { | |
display: flex; | |
flex-direction: row; | |
position: relative; | |
@include clearfix; | |
} | |
} | |
$cols: 6; | |
$gutter: 24px; | |
@function grid($col) { | |
$result: #{1} / $col ; | |
@return $result; | |
} | |
@for $i from 1 through $cols { | |
.col-grid-#{$i} { | |
grid-column: $i ; | |
} | |
} | |
@for $i from 1 through $cols { | |
.col-grid-1-#{$i} { | |
grid-column: grid($i); | |
} | |
} | |
.col-grid-2-2 { | |
grid-column: 1/4; | |
grid-row: 1/4; | |
} | |
body { | |
background: #151515; | |
} | |
.object { | |
background-color: red; | |
width: 100%; | |
height: 100px; | |
} |
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
<body> | |
<div class="container"> | |
<div class="row"> | |
<div class="object col-grid-2-2"></div> | |
<div class="object">1</div> | |
<div class="object">2</div> | |
<div class="object">3</div> | |
<div class="object">4</div> | |
<div class="object"></div> | |
<div class="object"></div> | |
<div class="object"></div> | |
<div class="object"></div> | |
<div class="object"></div> | |
<div class="object"></div> | |
<div class="object"></div> | |
<div class="object"></div> | |
<div class="object"></div> | |
<div class="object"></div> | |
<div class="object"></div> | |
</div> | |
</div> | |
</body> |
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
.container { | |
display: flex; | |
width: 100%; | |
/* 1 */ | |
max-width: 1024px; | |
/* 1 */ | |
margin-left: auto; | |
/* 2 */ | |
margin-right: auto; | |
/* 2 */ | |
padding-left: calc($gutter / 2); | |
/* 3 */ | |
padding-right: 20px; | |
/* 3 */ | |
} | |
.container::after, .container::before { | |
content: ''; | |
display: table; | |
clear: both; | |
} | |
@supports (display: grid) { | |
.container { | |
display: grid; | |
} | |
} | |
.row { | |
display: grid; | |
grid-template-columns: repeat(6, 1fr); | |
grid-template-rows: auto; | |
gap: 24px; | |
} | |
@supports not (display: grid) { | |
.row { | |
display: flex; | |
flex-direction: row; | |
position: relative; | |
} | |
.row::after, .row::before { | |
content: ''; | |
display: table; | |
clear: both; | |
} | |
} | |
.col-grid-1 { | |
grid-column: 1; | |
} | |
.col-grid-2 { | |
grid-column: 2; | |
} | |
.col-grid-3 { | |
grid-column: 3; | |
} | |
.col-grid-4 { | |
grid-column: 4; | |
} | |
.col-grid-5 { | |
grid-column: 5; | |
} | |
.col-grid-6 { | |
grid-column: 6; | |
} | |
.col-grid-1-1 { | |
grid-column: 1 / 1; | |
} | |
.col-grid-1-2 { | |
grid-column: 1 / 2; | |
} | |
.col-grid-1-3 { | |
grid-column: 1 / 3; | |
} | |
.col-grid-1-4 { | |
grid-column: 1 / 4; | |
} | |
.col-grid-1-5 { | |
grid-column: 1 / 5; | |
} | |
.col-grid-1-6 { | |
grid-column: 1 / 6; | |
} | |
.col-grid-2-2 { | |
grid-column: 1/4; | |
grid-row: 1/4; | |
} | |
body { | |
background: #151515; | |
} | |
.object { | |
background-color: red; | |
width: 100%; | |
height: 100px; | |
} |
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