Skip to content

Commit

Permalink
add better solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihakurochkin committed Nov 30, 2024
1 parent 8469d0c commit fcd3a1c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<title>Calendar</title>
<link
rel="stylesheet"
href="./styles/blocks/index.scss"
href="./styles/main.scss"
/>
</head>
<body>
<div class="calendar">
<div class="calendar calendar--start-day-sun calendar--month-length-31">
<div class="calendar__day"></div>
<div class="calendar__day"></div>
<div class="calendar__day"></div>
Expand Down
8 changes: 7 additions & 1 deletion src/styles/blocks/index.scss → src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../utils/variables';
@import './utils/variables';

body {
margin: 0;
Expand Down Expand Up @@ -55,5 +55,11 @@ body {
display: none;
}
}

@for $i from 28 through 31 {
.calendar--month-length-#{$i} .calendar__day:nth-child(n + #{$i + 1}) {
display: none;
}
}
}
}
19 changes: 9 additions & 10 deletions src/styles/utils/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ $col-count: 7;
$gap: 1;
$cell-width: 100;
$cell-height: 100;
/* stylelint-disable */
$days-of-week:
'mon' 0,
'tue' 1,
'wed' 2,
'thu' 3,
'fri' 4,
'sat' 5,
'sun' 6;
/* stylelint-enable */
$days-of-week: (
'mon': 0,
'tue': 1,
'wed': 2,
'thu': 3,
'fri': 4,
'sat': 5,
'sun': 6,
);
$month-length: 31;
$current-day: 'sun';

0 comments on commit fcd3a1c

Please sign in to comment.