summaryrefslogtreecommitdiffstats
path: root/asset/css/schedule-element.less
blob: 1905a056e4f7bfbc20be6c10959ca33d71a28d40 (plain)
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
// Schedule form element

.schedule-element {
  @input-border-radius: .25em;

  .ordinal {
    display: flex;
    flex-wrap: wrap;

    .radio-label {
      flex: 1 1 auto;
    }

    select {
      flex: 1 1 auto;

      &:first-of-type {
        margin-right: 1em;
      }

      &:disabled {
        color: @schedule-element-fields-disabled-color;
      }
    }
  }

  .radio-label {
    width: 100%;
    margin-bottom: .5em;
    display: flex;
    align-items: center; // To center the radio element on safari
  }

  .number-specifier > input[type="number"] {
    width: 5em;
    margin: 0 1em;
  }

  .monthly, .ordinal:not(.annually) {
    padding: .5em;
    margin-left: -.5em;
    border: 1px solid @schedule-element-fields-border-color;
    .rounded-corners(.75em);
  }

  .schedule-element-fields {
    list-style-type: none;
    margin: 0;
    padding: 0;
    .rounded-corners(.25em);
    overflow: hidden;
    display:flex;
    flex-wrap: wrap;

    &.disabled { // When the "On the" radio button is checked
      pointer-events: none;

      label {
        color: @schedule-element-fields-disabled-color;
        background-color: @schedule-element-fields-disabled-bg;
      }

      input:checked + label {
        background: @schedule-element-fields-disabled-selected-bg;
        color: @schedule-element-fields-disabled-color;
      }
    }

    li {
      width: calc(100% / 7); /* default for week based cols makes sense */

      label {
        display: block;
        width: 100%;
        cursor: pointer;
        text-align: center;
        padding: .75em 0;
        background: @schedule-element-fields-bg;
        color: @schedule-element-fields-color;

        &:hover {
          background-color: @schedule-element-fields-hover-bg;
        }

        &:focus {
          outline: none;
        }
      }

      input:checked + label {
        background-color: @schedule-element-fields-selected-bg;
        color: @schedule-element-fields-selected-color;
      }

      input:checked + label:hover {
        background-color: @schedule-element-fields-selected-hover-bg;
        border-color: @schedule-element-fields-selected-hover-bg;
      }
    }

    &.multiple-fields {
      li:not(:last-child) label {
        border-right: 1px solid @schedule-element-fields-border-color;
      }

      input:focus + label {
        box-shadow: inset 0 0 0 3px @schedule-element-fields-outline-color;
      }

      input:checked:focus + label {
        box-shadow: inset 0 0 0 3px @schedule-element-fields-selected-outline-color;
      }
    }

    &.single-fields {
      li {
        padding-right: 1px;
      }

      li label {
        .rounded-corners(.25em);
        margin-right: 1px;
        margin-bottom: 1px;
      }

      li label {
        border-right: none;
      }

      &:focus-within {
        outline: 3px solid @schedule-element-fields-outline-color;
        outline-offset: 2px;
      }

      &:focus-within + .note {
        display: block;
      }

      input:checked + label:hover {
        background-color: @schedule-element-fields-selected-bg;
      }
    }
  }

  .note {
    display: none;
    padding: .5em;
    background: @schedule-element-keyboard-note-bg;
    .rounded-corners(.25em);
    text-align: center;
    margin-top: 1em;
    line-height: 1.25;
  }

  /* .weekly */
  .weekly {  }

  /* .monthly styles */
  .monthly {
    li label {
      border-top: 1px solid @schedule-element-fields-border-color;
    }

    li:first-child,
    li:nth-child(2),
    li:nth-child(3),
    li:nth-child(4),
    li:nth-child(5),
    li:nth-child(6),
    li:nth-child(7) {
      label {
        border-top: none;
      }
    }

    /* last of row should not have a border */
    .schedule-element-fields li:nth-child(7n) label {
      border-right: none;
    }
  }


  /* .annually styles */
  .annually {
    li {
      width: 25%; // 100% / 4 elements
    }

    li:nth-child(4n) label {
      margin-right: 0;
    }

    .toggle-slider-controls {
      display: flex;
      column-gap: 1em;
      align-items: center;
      margin-top: 1em;
      margin-bottom: -.6em;
    }
  }
}

.schedule-recurrences {
  line-height: 1.1em;
  padding-top: 0.5625em;

  p {
    color: @schedule-element-fields-disabled-color;
  }
}