Skip to content

Commit

Permalink
allow alternative style for all types
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier committed Jun 12, 2022
1 parent 860cc03 commit 73b9690
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/components/CheckboxRadioSwitch/CheckboxRadioSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default {
'checkbox-radio-switch--checked': isChecked,
'checkbox-radio-switch--disabled': disabled,
'checkbox-radio-switch--indeterminate': indeterminate,
'checkbox-radio-switch--alternate-radio': isAlternativeRadio,
'checkbox-radio-switch--button-variant': buttonVariant,
}"
:style="cssVars"
class="checkbox-radio-switch">
Expand All @@ -171,7 +171,7 @@ export default {
<label :for="id" class="checkbox-radio-switch__label">
<div v-if="loading" class="icon-loading-small checkbox-radio-switch__icon" />
<icon :is="checkboxRadioIconElement"
v-else-if="!isAlternativeRadio"
v-else-if="!buttonVariant"
:size="size"
class="checkbox-radio-switch__icon"
title=""
Expand Down Expand Up @@ -235,7 +235,7 @@ export default {
/**
* Toggle the alternative style (for radio type only)
*/
alternativeStyle: {
buttonVariant: {
type: Boolean,
default: false,
},
Expand Down Expand Up @@ -325,10 +325,6 @@ export default {
return TYPE_CHECKBOX
},
isAlternativeRadio() {
return this.type === TYPE_RADIO && this.alternativeStyle
},
/**
* Check if that entry is checked
* If value is defined, we use that as the checked value
Expand Down Expand Up @@ -498,7 +494,7 @@ $spacing: 4px;
color: var(--color-primary-element-light);
}
&.checkbox-radio-switch--alternate-radio.checkbox-radio-switch {
&--button-variant.checkbox-radio-switch {
border: 2px solid var(--color-border-dark);
border-radius: var(--border-radius);
Expand All @@ -524,12 +520,12 @@ $spacing: 4px;
background-color: var(--color-background-dark);
}
}
}
.checkbox-radio-switch__label {
border-radius: 0 !important;
width: 100% !important;
margin: 0 !important;
}
&--button-variant &__label {
border-radius: 0 !important;
width: 100% !important;
margin: 0 !important;
}
}
</style>

0 comments on commit 73b9690

Please sign in to comment.