Summary Files Commits Branches @commit @diff @stats
path: root / src / calendars.less
blob: c94d674ae0082d931c9dffe0104f62347d8bc254 (plain) (blame)
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
// Calendars
.calendar {
  border: .1rem solid @border-color;
  border-radius: @border-radius;
  display: block;
  text-align: center;

  .calendar-nav {
    align-content: space-between;
    align-items: center;
    background: @bg-color;
    border-top-left-radius: @border-radius;
    border-top-right-radius: @border-radius;
    display: flex;
    font-size: 2rem;
    padding: 1rem;
  }

  .calendar-header,
  .calendar-body {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem 0;

    .calendar-date {
      flex: 0 0 14%;
    }
  }

  .calendar-header {
    border-bottom: .1rem solid @border-color;
    color: @gray-color;
  }

  .calendar-body {
    color: @dark-gray-color;

    .calendar-date {
      & {
        border: 0;
        padding: .5rem;

        .date-item {
          color: @dark-gray-color;
        }
      }

      &.calendar-range {
        position: relative;

        .date-item {
          &::before {
            background: @secondary-color;
            content: "";
            height: 3.2rem;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translateY(-50%);
            width: 50%;
            z-index: -9;
          }
        }

        & + .calendar-range {
          .date-item {
            &::before {
              left: 0;
              width: 100%;
            }
            &.active {
              &::before {
                width: 50%;
              }
            }
          }
        }
      }

      &.prev-month,
      &.next-month {
        .date-item {
          opacity: .25;
        }
      }
    }

    .date-item {
      appearance: none;
      background: transparent;
      border: .1rem solid transparent;
      border-radius: 50%;
      .control-transition();
      cursor: pointer;
      display: inline-block;
      height: 3.2rem;
      line-height: 2rem;
      padding: .5rem;
      text-align: center;
      text-decoration: none;
      vertical-align: middle;
      white-space: nowrap;
      width: 3.2rem;

      &:focus,
      &:hover {
        background: @light-secondary-color;
        border-color: @dark-secondary-color;
        color: @primary-color;
        text-decoration: none;
      }
      &:active,
      &.active {
        background: @dark-primary-color;
        border-color: darken(@dark-primary-color, 5%);
        color: @light-color;
      }
      &.date-today {
        background: @secondary-color;
        color: @primary-color;
      }

      // Calendar badge support
      &.badge {
        &::after {
          position: absolute;
          top: .4rem;
          right: .4rem;
          transform: translate(50%, -50%);
        }
      }
    }
  }
}