Skip to content

Commit

Permalink
feat: adapt css to state indeterminate
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Pajung authored and nowseemee committed Jul 19, 2021
1 parent dcea072 commit d7c95cc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export class CheckboxGroup {
label="checkbox"
name="nameOfCheckbox"
helper-text="helperText"
checked
></scale-checkbox>
</div>
<div class="checkbox-group__container">
Expand All @@ -113,16 +112,24 @@ export class CheckboxGroup {
<scale-checkbox
input-id="checkbox3"
value="3"
label="checkbox"
name="nameOfCheckbox"
></scale-checkbox>
checked
>Checkbox Slot</scale-checkbox>
</div>
<div class="checkbox-group__checkbox">
<scale-checkbox
input-id="checkbox4"
value="4"
label="checkbox"
name="nameOfCheckbox"
></scale-checkbox>
</div>
<div class="checkbox-group__checkbox">
<scale-checkbox
input-id="checkbox5"
value="5"
label="checkbox"
name="nameOfCheckbox"
checked
></scale-checkbox>
</div>
Expand Down
30 changes: 30 additions & 0 deletions packages/components/src/components/checkbox/checkbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ scale-checkbox {
.checkbox__control {
background: var(--color-disabled);
}
.checkbox--disabled.checkbox--indeterminate
.checkbox__control-wrapper
.checkbox__control {
background: var(--color-disabled);
}
.checkbox--disabled.checkbox--checked
.checkbox__control-wrapper
.checkbox__icon {
Expand All @@ -139,6 +144,14 @@ scale-checkbox {
border-color: var(--color-primary-hover);
background: var(--color-primary-hover);
}
.checkbox--enabled.checkbox--indeterminate
input:hover
~ .checkbox__control-wrapper
.checkbox__control {
box-shadow: none;
border-color: var(--color-primary-hover);
background: var(--color-primary-hover);
}
.checkbox--checked.checkbox--eanabled
input:active
~ .checkbox__control-wrapper
Expand All @@ -150,6 +163,17 @@ scale-checkbox {
border-color: var(--color-primary-active);
background: var(--color-primary-active);
}
.checkbox--indeterminate.checkbox--eanabled
input:active
~ .checkbox__control-wrapper
.checkbox__control/* ,
.checkbox
input:checked:not([disabled])
~ .checkbox__control-wrapper:active
.checkbox__control */{
border-color: var(--color-primary-active);
background: var(--color-primary-active);
}
.checkbox--enabled.checkbox--checked
input:active
~ .checkbox__control-wrapper
Expand All @@ -167,6 +191,12 @@ scale-checkbox {
border: var(--scl-spacing-1) solid var(--color-primary);
background: var(--color-primary);
}
.checkbox--enabled.checkbox--indeterminate
.checkbox__control-wrapper
.checkbox__control {
border: var(--scl-spacing-1) solid var(--color-primary);
background: var(--color-primary);
}
.checkbox.checkbox--disabled .checkbox__control-wrapper .checkbox__control {
border-color: var(--color-disabled);
}
Expand Down

0 comments on commit d7c95cc

Please sign in to comment.