|
2 | 2 | <div>
|
3 | 3 | <div id="event-form-mask" @click="close" v-show="active"></div>
|
4 | 4 | <div id="event-form" :class="{ active }" :style="{ left, top }">
|
5 |
| - <h4>{{ isNew() ? 'Add event' : 'Edit event' }}</h4> |
| 5 | + <h4 :class="selectedColor">{{ isNew() ? 'Add event' : 'Edit event' }}</h4> |
6 | 6 | <p v-if="event.date">{{ event.date.format('dddd, MMM Do') }}</p>
|
7 | 7 | <div class="text">
|
8 |
| - <input v-focus placeholder="e.g. Important meeting" type="text" v-model="description" @keypress.enter="saveEvent"> |
| 8 | + <input v-focus placeholder="e.g. Important meeting" type="text" :class="selectedColor" v-model="description" @keypress.enter="saveEvent"> |
9 | 9 | </div>
|
10 | 10 | <div class="event-colors">
|
11 | 11 | <div :class="[color, color === selectedColor ? 'selected' : '' ]" v-for="color in colors" @click="selectColor(color)"></div>
|
12 | 12 | </div>
|
13 | 13 | <div class="buttons">
|
14 |
| - <button @click="deleteEvent" class="btn-danger" v-if="!isNew()">Delete</button> |
15 |
| - <button @click="saveEvent">{{ isNew() ? 'Create' : 'Save' }}</button> |
| 14 | + <button @click="deleteEvent" class="delete-btn" v-if="!isNew()">Delete</button> |
| 15 | + <button @click="saveEvent" :class="selectedColor">{{ isNew() ? 'Create' : 'Save' }}</button> |
16 | 16 | </div>
|
17 | 17 | <div id="close-button" @click="close">×</div>
|
18 | 18 | </div>
|
|
117 | 117 | color: $dusty-gray;
|
118 | 118 | font-weight: normal;
|
119 | 119 | font-size: 1.15rem;
|
| 120 | +
|
| 121 | + @include colorize($property: 'color'); |
120 | 122 | }
|
121 | 123 |
|
122 | 124 | p {
|
|
132 | 134 | width: calc(100% - 0.75rem);
|
133 | 135 | padding: 0.25rem;
|
134 | 136 | font-size: 0.75rem;
|
| 137 | + border: 1px solid lightgray; |
| 138 | +
|
| 139 | + @include colorize($property: 'border-color'); |
| 140 | +
|
| 141 | + &:focus { |
| 142 | + outline: none; |
| 143 | + } |
135 | 144 | }
|
136 | 145 | margin-bottom: 0.75rem;
|
137 | 146 | }
|
138 | 147 | .buttons {
|
139 | 148 | text-align: right;
|
| 149 | +
|
140 | 150 | button {
|
141 |
| - $button-col: $pickled-bluewood; |
142 |
| - padding: 0.3rem 0.5rem; |
143 |
| - background-color: $button-col; |
144 |
| - border: 1px solid darken($button-col, 5%); |
145 |
| - font-weight: bold; |
146 |
| - border-radius: 2px; |
147 |
| - color: white; |
148 |
| - cursor: pointer; |
149 |
| - &:focus { |
150 |
| - outline: none; |
151 |
| - } |
152 |
| - &:hover { |
153 |
| - background-color: lighten($button-col, 4%); |
154 |
| - border: 1px solid $button-col; |
155 |
| - } |
156 |
| - &.btn-danger { |
157 |
| - $button-col: crimson; |
158 |
| - background-color: $button-col; |
159 |
| - border: 1px solid darken($button-col, 5%); |
160 |
| - &:hover { |
161 |
| - background-color: lighten($button-col, 4%); |
162 |
| - border: 1px solid $button-col; |
163 |
| - } |
| 151 | + @include button; |
| 152 | +
|
| 153 | + &.delete-btn { |
| 154 | + color: crimson; |
| 155 | + background: white; |
| 156 | + border: 1px solid transparent; |
164 | 157 | }
|
165 | 158 | }
|
166 | 159 | }
|
|
179 | 172 | margin: 0 1px;
|
180 | 173 | }
|
181 | 174 |
|
182 |
| - &.green { background: $green; } |
183 |
| - &.blue { background: $blue; } |
184 |
| - &.purple { background: $purple; } |
185 |
| - &.pink { background: $pink; } |
186 |
| - &.orange { background: $orange; } |
187 |
| - &.yellow { background: $yellow; } |
| 175 | + @include colorize($property: 'background'); |
188 | 176 | }
|
189 | 177 |
|
190 | 178 | #close-button {
|
|
0 commit comments