-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic Structure Created with Components
- Loading branch information
1 parent
b53328b
commit 2ab786c
Showing
13 changed files
with
1,111 additions
and
4,597 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,82 @@ | ||
$breakpoints: ( | ||
"xs": 0, | ||
"sm": 480px, | ||
"md": 720px, | ||
"lg": 960px, | ||
"xl": 1200px, | ||
"xxl": 1400px | ||
"xs": 0, | ||
"sm": 480px, | ||
"md": 720px, | ||
"lg": 960px, | ||
"xl": 1200px, | ||
"xxl": 1400px | ||
); | ||
|
||
// A more general mixin for breakpoints | ||
@mixin breakpoint($size) { | ||
@media (min-width: map-get($breakpoints, $size)) { | ||
@content; | ||
} | ||
@mixin xs(){ | ||
@media (min-width: map-get($breakpoints, "xs")) { | ||
@content; | ||
} | ||
} | ||
|
||
// Handling specific breakpoints | ||
.responsive-text { | ||
// Default (for xs, or smallest screens) | ||
color: red; | ||
@mixin sm(){ | ||
@media (min-width: map-get($breakpoints, "sm")) { | ||
@content; | ||
} | ||
} | ||
|
||
@mixin md(){ | ||
@media (min-width: map-get($breakpoints, "md")) { | ||
@content; | ||
} | ||
} | ||
|
||
@mixin lg(){ | ||
@media (min-width: map-get($breakpoints, "lg")) { | ||
@content; | ||
} | ||
} | ||
|
||
@mixin xl(){ | ||
@media (min-width: map-get($breakpoints, "xl")) { | ||
@content; | ||
} | ||
} | ||
|
||
@include breakpoint("sm") { | ||
color: blue; | ||
} | ||
@mixin xxl(){ | ||
@media (min-width: map-get($breakpoints, "xxl")) { | ||
@content; | ||
} | ||
} | ||
|
||
|
||
@mixin breakpoint($bp: 0){ | ||
@media (min-width: $bp) { | ||
@content; | ||
} | ||
} | ||
|
||
@include breakpoint("md") { | ||
color: green; | ||
} | ||
.responsive-text{ | ||
@include xs(){ | ||
color: red; | ||
} | ||
|
||
@include breakpoint("lg") { | ||
color: yellow; | ||
} | ||
@include sm(){ | ||
color: blue; | ||
} | ||
|
||
@include breakpoint("xl") { | ||
color: purple; | ||
} | ||
@include md(){ | ||
color: green; | ||
} | ||
|
||
@include breakpoint("xxl") { | ||
color: orange; | ||
} | ||
@include lg(){ | ||
color: yellow; | ||
} | ||
|
||
// Custom breakpoint beyond predefined ones | ||
@include breakpoint(1600px) { | ||
color: pink; | ||
} | ||
@include xl(){ | ||
color: purple; | ||
} | ||
|
||
@include xxl(){ | ||
color: orange; | ||
} | ||
|
||
@include breakpoint(1600px){ | ||
color: pink; | ||
} | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,122 @@ | ||
@use 'sass:math'; | ||
|
||
$grid-columns: 12; | ||
$grid-gaps: ( | ||
"0": 0, | ||
"1": 4px, | ||
"2": 8px, | ||
"3": 12px, | ||
"4": 16px, | ||
"5": 20px, | ||
"6": 24px, | ||
"7": 28px, | ||
"8": 32px, | ||
"9": 36px, | ||
"10": 40px, | ||
"11": 44px, | ||
"12": 48px, | ||
"13": 52px, | ||
"14": 56px, | ||
"15": 60px, | ||
"16": 64px, | ||
"17": 68px, | ||
"18": 72px, | ||
"19": 76px, | ||
"20": 80px, | ||
"21": 84px, | ||
"22": 88px, | ||
"23": 92px, | ||
"24": 96px, | ||
"25": 100px | ||
); | ||
|
||
$layout-values: flex-start, flex-end , center, space-between, space-around, space-evenly; | ||
|
||
|
||
.container { | ||
width: 100%; | ||
max-width: 1200px; | ||
margin: 0 auto; | ||
padding: 0 20px; | ||
box-sizing: border-box; | ||
width: 100%; | ||
max-width: 1200px; | ||
margin: 0 auto; | ||
padding: 0 20px; | ||
box-sizing: border-box; | ||
} | ||
|
||
.row { | ||
display: flex; | ||
flex-flow: row wrap; | ||
display: flex; | ||
flex-flow: row wrap; | ||
} | ||
|
||
@include xs() { | ||
@for $i from 1 through $grid-columns { | ||
.col-xs-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
} | ||
// grid gaps | ||
@each $key, $value in $grid-gaps { | ||
.gap-#{$key} > * { | ||
padding: $value; | ||
} | ||
|
||
.gap-#{$key}{ | ||
margin-left: -$value; | ||
margin-right: -$value; | ||
} | ||
} | ||
|
||
@include sm() { | ||
@for $i from 1 through $grid-columns { | ||
.col-sm-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
} | ||
// justify content classes | ||
@each $value in $layout-values { | ||
.justify-#{$value} { | ||
justify-content: $value; | ||
} | ||
} | ||
|
||
@include md() { | ||
@for $i from 1 through $grid-columns { | ||
.col-md-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
// Column definitions for different breakpoints | ||
@for $i from 1 through $grid-columns { | ||
// Extra small columns (xs) | ||
.col-xs-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
|
||
// Small columns (sm) | ||
@include sm() { | ||
.col-sm-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
} | ||
} | ||
|
||
// Medium columns (md) | ||
@include md() { | ||
.col-md-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
} | ||
|
||
// Large columns (lg) | ||
@include lg() { | ||
.col-lg-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
} | ||
|
||
// Extra-large columns (xl) | ||
@include xl() { | ||
.col-xl-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
} | ||
|
||
@include lg() { | ||
@for $i from 1 through $grid-columns { | ||
.col-lg-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
// Extra-extra-large columns (xxl) | ||
@include xxl() { | ||
.col-xxl-#{$i} { | ||
box-sizing: border-box; | ||
flex-grow: 0; | ||
width: math.div($i * 100%, $grid-columns); | ||
} | ||
} | ||
} | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@use 'sass:math'; | ||
|
||
%flex-layout{ | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
box-sizing: border-box; | ||
} | ||
|
||
.navbar{ | ||
@extend %flex-layout; | ||
padding: $base-padding $base-padding * 2; | ||
box-shadow: $base-box-shadow; | ||
|
||
.site-title{ | ||
font-size: $base-font-size * 1.5; | ||
} | ||
|
||
.container{ | ||
@extend %flex-layout; | ||
} | ||
} | ||
|
||
@each $key, $val in $colors { | ||
.navbar-#{$key} { | ||
@extend .navbar; | ||
background-color: $val; | ||
} | ||
} |
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
Oops, something went wrong.