-
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
calendar solution #3986
base: master
Are you sure you want to change the base?
calendar solution #3986
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,58 @@ | ||
body { | ||
margin: 0; | ||
font-family: Arial, Helvetica, sans-serif; | ||
height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.calendar { | ||
width: calc($day-size * 7 + $gap-size * 6); | ||
display: flex; | ||
flex-wrap: wrap; | ||
column-count: 7; | ||
gap: $gap-size; | ||
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 variable |
||
padding: 10px; | ||
|
||
&__day { | ||
cursor: pointer; | ||
box-sizing: border-box; | ||
position: relative; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #eee; | ||
border: 1px solid black; | ||
height: $day-size; | ||
width: $day-size; | ||
transition: 0.5s; | ||
} | ||
|
||
&__day:hover { | ||
background-color: #ffbfcb; | ||
transform: translate(0, -20px); | ||
} | ||
|
||
@for $i from 1 through 31 { | ||
&__day:nth-child(#{$i})::before { | ||
content: '#{$i}'; | ||
position: absolute; | ||
text-align: center; | ||
font-size: 30px; | ||
color: black; | ||
} | ||
} | ||
|
||
@each $day, $day-position in $week-days { | ||
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 variable |
||
&--start-day-#{$day} > &__day:first-child { | ||
margin-left: calc(($day-size + $gap-size) * $day-position); | ||
} | ||
} | ||
|
||
@for $number from 28 through 31 { | ||
&--month-length-#{$number} :nth-child(n + #{$number + 1}) { | ||
display: none; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
body { | ||
margin: 0; | ||
} | ||
@import './variables'; | ||
@import './calendar'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$week-days: ( | ||
'mon': 0, | ||
'tue': 1, | ||
'wed': 2, | ||
'thu': 3, | ||
'fri': 4, | ||
'sat': 5, | ||
'sun': 6, | ||
); | ||
$day-size: 100px; | ||
$gap-size: 1px; |
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 variable
$day-size
is used but not defined in this file. Ensure it is defined or imported from another SCSS file.