forked from michael-hack/bulma-calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalendar.sass
212 lines (207 loc) · 5.73 KB
/
calendar.sass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
$calendar-border: none !default
$calendar-border-radius: $radius-small !default
$calendar-header-color: $primary !default
$calendar-date-hover: $white-ter !default
$calendar-today-background: transparent !default
$calendar-today-border-color: $primary !default
$calendar-today-color: $primary !default
$calendar-current-background: transparent !default
$calendar-current-border-color: $primary !default
$calendar-current-color: $primary !default
=css3-prefix($property, $value)
-webkit-#{$property}: #{$value}
-khtml-#{$property}: #{$value}
-moz-#{$property}: #{$value}
-ms-#{$property}: #{$value}
-o-#{$property}: #{$value}
#{$property}: #{$value}
=calendar
.calendar
background: $white
border: $calendar-border
border-radius: $calendar-border-radius
display: block
min-width: 20rem
text-align: center
max-width: 20rem
&.is-active
display: initial
.calendar-nav
align-items: center
background: $calendar-header-color
color: $white
border-top-left-radius: $radius-small
border-top-right-radius: $radius-small
display: flex
align-items: center
justify-content: space-between
font-size: $size-5
padding: .5rem
.calendar-nav-left, .calendar-nav-right
flex-basis: auto
flex-grow: 0
flex-shrink: 0
.button
text-decoration: none
color: $white
&:hover
background: transparent
color: $white-ter
.calendar-nav-left
align-items: center
justify-content: flex-start
.calendar-nav-right
align-items: center
justify-content: flex-end
.calendar-header, .calendar-body
display: flex
flex-wrap: wrap
justify-content: center
padding: .2rem 0
.calendar-header .calendar-date, .calendar-body .calendar-date
flex: 0 0 14.28%
max-width: 14.28%
.calendar-header
background: darken($calendar-header-color, 5%)
color: findColorInvert( $calendar-header-color )
font-size: $size-7
.calendar-body
padding: 0
color: $grey
.calendar-date
border: 0
padding: .4rem
&.is-current
.date-item
background: $calendar-current-background
border-color: $calendar-current-border-color
color: $calendar-current-color
.date-item
appearance: none
background: transparent
border: .1rem solid transparent
border-radius: 100%
color: $text
cursor: pointer
height: 2.2rem
line-height: 1.4rem
outline: none
padding: .3rem
position: relative
text-align: center
text-decoration: none
transition: all .2s ease
vertical-align: middle
white-space: nowrap
width: 2.2rem
&.is-today
background: $calendar-today-background
border-color: $calendar-today-border-color
color: $calendar-today-color
&:focus
background: $calendar-date-hover
border-color: $calendar-date-hover
color: findColorInvert( $calendar-date-hover )
text-decoration: none
&:hover
background: $calendar-date-hover
border-color: $calendar-date-hover
color: findColorInvert( $calendar-date-hover )
text-decoration: none
&.is-active
background: $primary
border-color: $primary
color: findColorInvert( $primary )
&.is-disabled,
&[disabled]
.date-item, .calendar-event
cursor: default
opacity: .25
pointer-events: none
.calendar-range
position: relative
&::before
background: lighten($primary, 50%)
content: ""
height: 2.2rem
left: 0
position: absolute
right: 0
top: 50%
transform: translateY(-50%)
&.range-start::before
left: 50%
&.range-end::before
right: 50%
.date-item
color: $primary
&.is-large
max-width: 100%
.calendar-body
.calendar-date
border-bottom: $calendar-border
border-right: $calendar-border
display: flex
flex-direction: column
height: 11rem
padding: 0
&:nth-child(7n)
border-right: 0
&:nth-last-child(-n+7)
border-bottom: 0
.date-item
align-self: flex-end
height: 2.2rem
margin-right: .5rem
margin-top: .5rem
.calendar-range
&::before
top: 1.9rem
&.range-start::before
left: auto
width: 1.9rem
&.range-end::before
right: 1.9rem
.calendar-events
flex-grow: 1
line-height: 1
overflow-y: auto
padding: .5rem
.calendar-event
background-color: $grey
border-radius: $radius-small
color: $white
display: block
font-size: 1rem
margin: .2rem auto
overflow: hidden
padding: .3rem .4rem
text-align: left
text-overflow: ellipsis
vertical-align: baseline
white-space: nowrap
@each $name, $pair in $colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
background-color: $color
color: $color-invert
.datepicker
display: none
&.is-active
display: initial
.calendar
min-width: 20rem
display: initial
max-width: 20rem
+calendar
.is-overlay
+overlay
position: fixed
background-color: rgba( $dark, .75)
+ .calendar
position: fixed !important
top: 50% !important
left: 50% !important
+css3-prefix( 'transform', 'translate(-50%, -50%)' )
+calendar