-
Notifications
You must be signed in to change notification settings - Fork 5k
add task solution #5466
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
base: master
Are you sure you want to change the base?
add task solution #5466
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,64 @@ | ||
| @use 'sass:list'; | ||
|
|
||
| $modifikator: mon, tue, wed, thu, fri, sat, sun; | ||
| $day-width: 100px; | ||
| $day-height: 100px; | ||
| $calendar-gap: 1px; | ||
|
|
||
| body { | ||
| margin: 0; | ||
| min-height: 100vh; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| padding: 0; | ||
| } | ||
|
|
||
|
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 project still contains an alternative stylesheet ( |
||
| .calendar { | ||
| width: $day-width * 7 + $calendar-gap * 6; | ||
| display: flex; | ||
| gap: $calendar-gap; | ||
| flex-wrap: wrap; | ||
| margin: auto; | ||
|
|
||
| &__day { | ||
| text-align: center; | ||
| align-content: center; | ||
| background-color: #eee; | ||
| box-sizing: border-box; | ||
| margin: 0; | ||
|
|
||
| width: $day-width; | ||
| height: $day-height; | ||
| border: 1px solid black; | ||
| transition-duration: 500ms; | ||
|
|
||
| &:hover { | ||
| cursor: pointer; | ||
| background-color: #ffbfcb; | ||
| transform: translateY(-20px); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @for $i from 1 through 31 { | ||
| .calendar .calendar__day:nth-child(#{$i})::before { | ||
| content: '#{$i}'; | ||
| font-family: Arial, Helvetica, sans-serif; | ||
| font-size: 30px; | ||
| } | ||
| } | ||
|
|
||
| @for $i from 28 through 31 { | ||
| .calendar--month-length-#{$i} .calendar__day:nth-child(n + #{$i + 1}) { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| @each $day in $modifikator { | ||
| $offset: (list.index($modifikator, $day) - 1) * ($day-width + $calendar-gap); | ||
|
|
||
| .calendar--start-day-#{$day} .calendar__day:first-child { | ||
| margin-left: $offset; | ||
| } | ||
| } | ||
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 description requires: "Use flex with
1pxgap and limit its width to exactly 7 columns +10pxpaddings" and "Don't use hardcodedpxvalues if they are used several times". Using a hardcodedwidth: 706px;here does not clearly express 7 columns plus paddings via variables and calculations. Consider deriving the width from$day-width,$calendar-gap, and padding variables to satisfy this requirement.