Skip to content

Commit

Permalink
variables seperate
Browse files Browse the repository at this point in the history
  • Loading branch information
pat5513 committed Dec 23, 2024
1 parent 1f56a2c commit ef58e8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/styles/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$week: (mon 0, tue 1, wed 2, thu 3, fri 4, sat 5, sun 6);
$day-size: 100px;
$gap-size: 1px;
7 changes: 3 additions & 4 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
$week: (mon 0, tue 1, wed 2, thu 3, fri 4, sat 5, sun 6);
$day-size: 100px;
@use './variables' as *;

body {
margin: 0;
Expand All @@ -14,13 +13,13 @@ body {
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
gap: $gap-size;
width: 726px;
padding: 10px;
gap: 1px;

@each $day, $index in $week {
&--start-day-#{$day} .calendar__day:first-child {
margin-left: ($day-size + 1px) * $index;
margin-left: ($day-size + $gap-size) * $index;
}
}

Expand Down

0 comments on commit ef58e8e

Please sign in to comment.