-
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 task solution #4021
base: master
Are you sure you want to change the base?
add task solution #4021
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
$cell-size: 100px; | ||
$gap: 1px; | ||
$days: ( | ||
'mon': 0, | ||
'tue': 1, | ||
'wed': 2, | ||
'thu': 3, | ||
'fri': 4, | ||
'sat': 5, | ||
'sun': 6, | ||
); | ||
|
||
html { | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 30px; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.calendar { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 1px; | ||
padding: 10px; | ||
width: calc($cell-size * 7 + $gap * 6); | ||
|
||
&__day { | ||
box-sizing: border-box; | ||
display: flex; | ||
width: 100px; | ||
height: 100px; | ||
border: 1px solid black; | ||
background-color: #eee; | ||
justify-content: center; | ||
align-items: center; | ||
transition-duration: 0.5s; | ||
&:hover { | ||
cursor: pointer; | ||
background-color: #ffbfcb; | ||
transform: translateY(-20px); | ||
} | ||
} | ||
} | ||
|
||
@for $i from 1 through 31 { | ||
.calendar__day:nth-child(n + #{$i})::before { | ||
content: '#{$i}'; | ||
} | ||
} | ||
|
||
@for $i from 28 through 31 { | ||
.calendar--month-length-#{$i} .calendar__day:nth-child(n + #{$i + 1}) { | ||
display: none; | ||
} | ||
} | ||
Comment on lines
+57
to
+61
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 BEM modifiers for |
||
|
||
@each $day, $i in $days { | ||
.calendar--start-day-#{$day} .calendar__day:first-child { | ||
margin-left: calc(#{$i} * $cell-size + #{$i * $gap}); | ||
} | ||
} | ||
Comment on lines
+63
to
+67
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 BEM modifiers for |
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.
Ensure that the BEM modifiers for
start-day
andmonth-length
are correctly implemented and that changing these modifiers reflects in the calendar layout as expected. This is crucial for maintaining the intended functionality and appearance of the calendar.