File tree Expand file tree Collapse file tree 2 files changed +33
-4
lines changed
src/components/NcCheckboxRadioSwitch Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 2323<template >
2424 <component :is =" wrapperElement"
2525 :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+ }"
2836 :aria-hidden =" true" >
2937 <!-- @slot The checkbox/radio icon, you can use it for adding an icon to the button variant
3038 @binding {bool} checked The input checked state
@@ -222,11 +230,26 @@ export default {
222230 }
223231
224232 & __icon > * {
225- color : var (--color-primary-element );
226233 width : var (--icon-size );
227234 height : var (--icon-size );
228235 }
229236
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+
230253 & , * {
231254 cursor : pointer ;
232255 }
Original file line number Diff line number Diff line change @@ -641,6 +641,11 @@ export default {
641641
642642 & --checked :not (&--disabled):focus-within & __content ,
643643 & --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 {
644649 background-color : var (--color-primary-element-light-hover );
645650 }
646651
@@ -666,7 +671,8 @@ export default {
666671 font-weight : bold ;
667672
668673 .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 );
670676 }
671677 }
672678 }
You can’t perform that action at this time.
0 commit comments