-
Notifications
You must be signed in to change notification settings - Fork 5k
calendar #5444
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?
calendar #5444
Changes from all commits
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,88 @@ | ||
| $square-size: 100px; | ||
| $border-weight: 1px; | ||
| $gap: 1px; | ||
| $padding: 10px; | ||
| $columns: 7; | ||
| $square-color: #eee; | ||
| $square-color-hover: #ffbfcb; | ||
| $font-family: Arial, Helvetica, sans-serif; | ||
| $font-size: 30px; | ||
| $transirtion-duration: 0.5s; | ||
|
|
||
| body { | ||
|
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 task description requires: |
||
| margin: 0; | ||
| height: 100vh; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
|
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. You have |
||
| overflow: hidden; | ||
| } | ||
|
|
||
| .calendar { | ||
| max-width: calc((($square-size) * $columns) + (($columns - 1) * $gap)); | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| justify-content: flex-start; | ||
| align-items: center; | ||
| gap: $gap; | ||
| margin: auto; | ||
| padding: $padding; | ||
|
|
||
| &__day { | ||
| position: relative; | ||
| height: $square-size; | ||
| width: $square-size; | ||
| border: $border-weight solid black; | ||
| background-color: $square-color; | ||
| font-size: $font-size; | ||
| font-family: $font-family; | ||
| box-sizing: border-box; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| cursor: pointer; | ||
| transition: | ||
| transform $transirtion-duration, | ||
| background-color $transirtion-duration; | ||
|
|
||
| &::before { | ||
| content: counter(day); | ||
| counter-increment: day; | ||
| position: absolute; | ||
| top: 50%; | ||
| left: 50%; | ||
| transform: translate(-50%, -50%); | ||
| } | ||
|
|
||
| &:hover { | ||
| background-color: $square-color-hover; | ||
| transform: translateY(-20px); | ||
| } | ||
| } | ||
|
|
||
| &--start-day-sun { | ||
| .calendar__day:first-child { | ||
| margin-left: 0; | ||
| } | ||
| } | ||
|
|
||
| @each $day, | ||
| $margin in (mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6, sun: 7) | ||
| { | ||
| &--start-day-#{$day} { | ||
| .calendar__day:first-child { | ||
| margin-left: (($square-size + $gap) * ($margin - 1)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @for $i from 28 through 31 { | ||
| &--month-length-#{$i} { | ||
| .calendar__day:nth-child(n + #{$i + 1}) { | ||
| display: none; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| counter-reset: day; | ||
| } | ||
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.
You have
class="calendar calendar--start-sun calendar--month-length-31 calendar--start-day-sun", but onlycalendar--start-day-*modifiers are defined in your SCSS and the description only mentionsstart-daymodifier. The extracalendar--start-sundoes nothing and doesn’t follow the specified modifier naming; remove it and rely oncalendar--start-day-sun.