-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Solution of task Calendar #3956
base: master
Are you sure you want to change the base?
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 |
---|---|---|
@@ -1,3 +1,70 @@ | ||
body { | ||
margin: 0; | ||
min-height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
box-sizing: border-box; | ||
} | ||
|
||
.calendar { | ||
padding: 10px; | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 1px; | ||
width: 706px; | ||
|
||
// .calendar__item | ||
|
||
&__day { | ||
box-sizing: border-box; | ||
list-style: none; | ||
height: 100px; | ||
width: 100px; | ||
background-color: #eee; | ||
border: 1px solid black; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
&:hover { | ||
background-color: #ffbfcb; | ||
transform: translateY(-20px); | ||
animation: move 0.5s; | ||
} | ||
} | ||
|
||
@for $number from 1 through 31 { | ||
& :nth-child(#{$number})::before { | ||
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 selector '& :nth-child(#{$number})::before' might cause specificity issues due to the space before ':nth-child'. Consider removing the space to ensure the styles are applied correctly to the intended elements. |
||
content: '#{$number}'; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 30px; | ||
} | ||
} | ||
|
||
$days: ('mon' 0, 'tue' 1, 'wed' 2, 'thu' 3, 'fri' 4, 'sat' 5, 'sun' 6); | ||
|
||
@each $day, $dayCount in $days { | ||
&--start-day-#{$day} :first-child { | ||
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. Similar to the previous comment, the selector '&--start-day-#{$day} :first-child' has a space that might lead to specificity issues. Remove the space to ensure the styles are applied correctly. |
||
margin-left: 101px * $dayCount; | ||
} | ||
} | ||
|
||
@for $number from 28 through 31 { | ||
&--month-length-#{$number} :nth-child(n + #{$number + 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 selector '&--month-length-#{$number} :nth-child(n + #{$number + 1})' also contains a space that might cause specificity issues. Consider removing the space to ensure the styles are applied correctly. |
||
display: none; | ||
} | ||
} | ||
|
||
@keyframes move { | ||
from { | ||
background-color: #eee; | ||
transform: translate(0); | ||
} | ||
|
||
to { | ||
background-color: #ffbfcb; | ||
transform: translate(0, -20px); | ||
} | ||
} | ||
} |
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.
Consider refactoring repeated
px
values into variables for better maintainability and readability. This will help make your code more efficient and easier to update in the future.