-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New files #5206
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?
New files #5206
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 |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| *::before, | ||
| *::after { | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| body { | ||
| margin: 0; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| .calendar { | ||
| @include flex-center; | ||
|
|
||
| min-height: 100vh; | ||
|
|
||
| &__container { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: $gap; | ||
| width: $calendar-width; | ||
| padding: $padding; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| &__day { | ||
| width: $day-size; | ||
| height: $day-size; | ||
| background-color: $color-light-gray; | ||
| border: $border solid $color-black; | ||
| box-sizing: border-box; | ||
| transition: | ||
| transform 0.5s ease, | ||
| background-color 0.5s ease; | ||
|
|
||
| @include flex-center; | ||
|
|
||
| font-family: Arial, sans-serif; | ||
| font-size: 30px; | ||
|
|
||
| @for $i from 1 through 31 { | ||
| &:nth-child(#{$i})::before { | ||
| content: '#{$i}'; | ||
| } | ||
| } | ||
|
|
||
| &:hover { | ||
| background-color: $color-pink; | ||
| transform: translateY(-20px); | ||
| cursor: pointer; | ||
| } | ||
| } | ||
|
|
||
| @each $day, $index in $days { | ||
| &--start-day-#{$day} .calendar__day:first-child { | ||
| margin-left: $index * ($day-size + $gap); | ||
| } | ||
| } | ||
|
|
||
| @for $length from 28 through 31 { | ||
| &--month-length-#{$length} { | ||
| .calendar__day:nth-child(n + #{$length + 1}) { | ||
| display: none; | ||
| } | ||
| } | ||
| } | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| @import './utils/variables'; | ||
| @import './utils/mixins'; | ||
| @import './base/base'; | ||
| @import './blocks/calendar'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @mixin flex-center { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| $day-size: 100px; | ||
| $columns: 7; | ||
| $gap: 1px; | ||
| $border: 1px; | ||
| $padding: 10px; | ||
| $days: ( | ||
| sun: 0, | ||
| mon: 1, | ||
| tue: 2, | ||
| wed: 3, | ||
| thu: 4, | ||
| fri: 5, | ||
| sat: 6 | ||
| ); | ||
|
Comment on lines
6
to
14
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. This breaks the requirement "The month should start at the correct column (Monday is the 1st, Friday is the 5th)." The |
||
| $color-pink: #FFBFCB; | ||
| $color-black: #000; | ||
| $color-light-gray: #eee; | ||
| $calendar-width: ($day-size * $columns) + ($gap * ($columns - 1)) + ($padding * 2); | ||
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.
This violates the implementation detail "Each day is a grey (
#eee)100pxsquare (including 1px black border)."$borderis declared as1without a unit. When used asborder: $border solid $color-black;this will produce an invalid CSS value (e.g.1 solid #000). Add the unit:$border: 1px;so the output becomes1px solid #000.