-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add solution #3977
base: master
Are you sure you want to change the base?
add solution #3977
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
@import '../utils/variables'; | ||
|
||
body { | ||
margin: 0; | ||
padding-top: 25px; | ||
} | ||
|
||
.calendar { | ||
display: flex; | ||
gap: $gap; | ||
flex-wrap: wrap; | ||
width: $col-count * $cell-width + $gap * $col-count; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the variables |
||
margin: 0 auto; | ||
|
||
&__day { | ||
display: flex; | ||
font-family: Arial, Helvetica, sans-serif; | ||
justify-content: center; | ||
align-items: center; | ||
font-size: 30px; | ||
line-height: 100%; | ||
box-sizing: border-box; | ||
background-color: #eee; | ||
width: $cell-width; | ||
height: $cell-height; | ||
border: 1px solid black; | ||
|
||
&:first-child { | ||
margin-left: ($col-count - 1) * $cell-width + $gap * ($col-count - 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The calculation for |
||
} | ||
|
||
@each $day, $number in $days-of-week { | ||
@if $day == $current-day { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that |
||
&:first-child { | ||
margin-left: $number * $cell-width + $gap * $number; | ||
} | ||
} | ||
} | ||
|
||
&:hover { | ||
transform: translateY(-20px); | ||
background-color: #ffbfcb; | ||
cursor: pointer; | ||
transition-duration: 500ms; | ||
} | ||
|
||
@for $days from 1 through 31 { | ||
&:nth-child(#{$days})::before { | ||
content: '#{$days}'; | ||
} | ||
} | ||
|
||
@for $i from $month-length + 1 through 32 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify that |
||
&:nth-child(#{$i}) { | ||
display: none; | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
$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 */ | ||
$month-length: 31; | ||
$current-day: 'sun'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stylesheet link references an
.scss
file. Browsers cannot directly interpret SCSS files. Ensure that this file is compiled to CSS and link the resulting CSS file instead.