File tree 2 files changed +33
-4
lines changed
src/components/NcCheckboxRadioSwitch
2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 23
23
<template>
24
24
<component :is="wrapperElement"
25
25
:for="!isButtonType ? id : null"
26
- class="checkbox-content">
27
- <span :class="['checkbox-content__icon', iconClass]"
26
+ class="checkbox-content"
27
+ :class="{
28
+ ['checkbox-content-' + type]: true,
29
+ 'checkbox-content--button-variant': buttonVariant,
30
+ }">
31
+ <span :class="{
32
+ 'checkbox-content__icon': true,
33
+ 'checkbox-content__icon--checked': isChecked,
34
+ [iconClass]: true
35
+ }"
28
36
:aria-hidden="true">
29
37
<!-- @slot The checkbox/radio icon, you can use it for adding an icon to the button variant
30
38
@binding {bool} checked The input checked state
@@ -222,11 +230,26 @@ export default {
222
230
}
223
231
224
232
&__icon > * {
225
- color: var(--color-primary-element);
226
233
width: var(--icon-size);
227
234
height: var(--icon-size);
228
235
}
229
236
237
+ &--button-variant {
238
+ .checkbox-content__icon:not(.checkbox-content__icon--checked) > * {
239
+ color: var(--color-primary-element);
240
+ }
241
+
242
+ .checkbox-content__icon--checked > * {
243
+ color: var(--color-primary-element-text);
244
+ }
245
+ }
246
+
247
+ &:not(&--button-variant) {
248
+ .checkbox-content__icon > * {
249
+ color: var(--color-primary-element);
250
+ }
251
+ }
252
+
230
253
&, * {
231
254
cursor: pointer;
232
255
}
Original file line number Diff line number Diff line change @@ -641,6 +641,11 @@ export default {
641
641
642
642
&--checked:not(&--disabled):focus-within &__content,
643
643
&--checked:not(&--disabled) &__content:hover {
644
+ background-color: var(--color-primary-element-hover);
645
+ }
646
+
647
+ &--checked:not(&--button-variant):not(&--disabled):focus-within &__content,
648
+ &--checked:not(&--button-variant):not(&--disabled) &__content:hover {
644
649
background-color: var(--color-primary-element-light-hover);
645
650
}
646
651
@@ -666,7 +671,8 @@ export default {
666
671
font-weight: bold;
667
672
668
673
.checkbox-radio-switch__content {
669
- background-color: var(--color-primary-element-light);
674
+ background-color: var(--color-primary-element);
675
+ color: var(--color-primary-element-text);
670
676
}
671
677
}
672
678
}
You can’t perform that action at this time.
0 commit comments