281 lines
8.6 KiB
CSS
281 lines
8.6 KiB
CSS
/*
|
|
Copyright 2019 Adobe. All rights reserved.
|
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software distributed under
|
|
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
governing permissions and limitations under the License.
|
|
*/
|
|
|
|
.spectrum-Checkbox {
|
|
/* todo: fix in DNA */
|
|
--spectrum-checkbox-m-emphasized-text-color-key-focus: var(--spectrum-checkbox-m-emphasized-text-color-hover);
|
|
--spectrum-checkbox-m-emphasized-box-border-color-selected-key-focus: var(--spectrum-checkbox-m-emphasized-box-border-color-selected-hover);
|
|
}
|
|
|
|
.spectrum-Checkbox {
|
|
color: var(--spectrum-checkbox-m-text-color);
|
|
}
|
|
|
|
.spectrum-Checkbox-checkmark,
|
|
.spectrum-Checkbox-partialCheckmark {
|
|
color: var(--spectrum-checkbox-m-checkmark-color);
|
|
}
|
|
|
|
.spectrum-Checkbox-box {
|
|
&:before {
|
|
forced-color-adjust: none;
|
|
border-color: var(--spectrum-checkbox-m-box-border-color);
|
|
background-color: var(--spectrum-checkbox-m-box-background-color);
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox-label {
|
|
color: var(--spectrum-checkbox-m-text-color);
|
|
}
|
|
|
|
/* Indetermiate is basically a checked state, so handle colors for checked state here */
|
|
.spectrum-Checkbox.is-indeterminate .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color-selected);
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox:hover {
|
|
&.is-indeterminate .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(
|
|
--spectrum-checkbox-m-box-border-color-selected-hover
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox:active {
|
|
&.is-indeterminate .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(
|
|
--spectrum-checkbox-m-box-border-color-selected-down
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color);
|
|
|
|
&:hover {
|
|
.spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(
|
|
--spectrum-checkbox-m-box-border-color-hover
|
|
);
|
|
}
|
|
}
|
|
.spectrum-Checkbox-label {
|
|
color: var(--spectrum-checkbox-m-text-color-hover);
|
|
}
|
|
}
|
|
|
|
&:active {
|
|
.spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color-down);
|
|
}
|
|
}
|
|
.spectrum-Checkbox-label {
|
|
color: var(--spectrum-checkbox-m-text-color-down);
|
|
}
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox .spectrum-Checkbox-input,
|
|
.spectrum-Checkbox .spectrum-Checkbox-input:checked {
|
|
&:disabled + .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(
|
|
--spectrum-checkbox-m-box-border-color-disabled
|
|
);
|
|
background-color: var(
|
|
--spectrum-checkbox-m-box-background-color-disabled
|
|
);
|
|
}
|
|
}
|
|
|
|
&:disabled ~ .spectrum-Checkbox-label {
|
|
forced-color-adjust: none;
|
|
color: var(--spectrum-checkbox-m-text-color-disabled);
|
|
}
|
|
}
|
|
|
|
/* Focus */
|
|
.spectrum-Checkbox-input {
|
|
&:focus-ring + .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color-key-focus);
|
|
}
|
|
&:after {
|
|
forced-color-adjust:none;
|
|
box-shadow: 0 0 0 var(--spectrum-checkbox-m-focus-ring-size-key-focus)
|
|
var(--spectrum-checkbox-m-focus-ring-color-key-focus);
|
|
}
|
|
}
|
|
.spectrum-Checkbox.is-indeterminate &,
|
|
&:checked {
|
|
&:focus-ring + .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(
|
|
--spectrum-checkbox-m-box-border-color-selected-key-focus
|
|
);
|
|
}
|
|
}
|
|
}
|
|
&:focus-ring ~ .spectrum-Checkbox-label {
|
|
color: var(--spectrum-checkbox-m-text-color-key-focus);
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox--emphasized
|
|
.spectrum-Checkbox-input:checked
|
|
+ .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox--emphasized.is-indeterminate .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox--emphasized.is-indeterminate
|
|
.spectrum-Checkbox-input:focus-ring
|
|
+ .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-emphasized-box-border-color-selected);
|
|
}
|
|
}
|
|
.spectrum-Checkbox--emphasized:hover {
|
|
&.is-indeterminate .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(
|
|
--spectrum-checkbox-m-emphasized-box-border-color-selected-hover
|
|
);
|
|
}
|
|
}
|
|
}
|
|
.spectrum-Checkbox--emphasized:active {
|
|
&.is-indeterminate .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(
|
|
--spectrum-checkbox-m-emphasized-box-border-color-selected-down
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox.is-invalid {
|
|
/* Extra-specific selectors added here to handle checked state */
|
|
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color-error);
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox-label {
|
|
color: var(--spectrum-checkbox-m-text-color-error);
|
|
}
|
|
|
|
&.is-indeterminate .spectrum-Checkbox-input:focus-ring,
|
|
.spectrum-Checkbox-input:focus-ring {
|
|
& + .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color-error-hover);
|
|
}
|
|
}
|
|
|
|
& ~ .spectrum-Checkbox-label {
|
|
color: var(--spectrum-checkbox-m-text-color-error-hover);
|
|
}
|
|
}
|
|
|
|
&:hover {
|
|
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color-error-hover);
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox-label {
|
|
color: var(--spectrum-checkbox-m-text-color-error-hover);
|
|
}
|
|
}
|
|
|
|
&:active {
|
|
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box,
|
|
.spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color-error-down);
|
|
}
|
|
}
|
|
|
|
.spectrum-Checkbox-label {
|
|
color: var(--spectrum-checkbox-m-text-color-error-down);
|
|
}
|
|
}
|
|
}
|
|
|
|
@media (forced-colors: active) {
|
|
.spectrum-Checkbox {
|
|
--spectrum-checkbox-m-box-background-color-disabled: ButtonFace;
|
|
--spectrum-checkbox-m-box-background-color: ButtonFace;
|
|
--spectrum-checkbox-m-box-border-color-disabled: GrayText;
|
|
--spectrum-checkbox-m-box-border-color-down: Highlight;
|
|
--spectrum-checkbox-m-box-border-color-error-down: Highlight;
|
|
--spectrum-checkbox-m-box-border-color-error-hover: Highlight;
|
|
--spectrum-checkbox-m-box-border-color-error: Highlight;
|
|
--spectrum-checkbox-m-box-border-color-hover: Highlight;
|
|
--spectrum-checkbox-m-box-border-color-key-focus: Highlight;
|
|
--spectrum-checkbox-m-box-border-color-selected-down: Highlight;
|
|
--spectrum-checkbox-m-box-border-color-selected-hover: Highlight;
|
|
--spectrum-checkbox-m-box-border-color-selected-key-focus: Highlight;
|
|
--spectrum-checkbox-m-box-border-color-selected: Highlight;
|
|
--spectrum-checkbox-m-box-border-color: ButtonText;
|
|
--spectrum-checkbox-m-checkmark-color: HighlightText;
|
|
--spectrum-checkbox-m-emphasized-box-border-color-selected-down: Highlight;
|
|
--spectrum-checkbox-m-emphasized-box-border-color-selected-hover: Highlight;
|
|
--spectrum-checkbox-m-emphasized-box-border-color-selected-hover: Highlight;
|
|
--spectrum-checkbox-m-emphasized-box-border-color-selected: Highlight;
|
|
--spectrum-checkbox-m-emphasized-text-color-hover: FieldText;
|
|
--spectrum-checkbox-m-focus-ring-color-key-focus: FieldText;
|
|
--spectrum-checkbox-m-text-color-disabled: GrayText;
|
|
--spectrum-checkbox-m-text-color-down: FieldText;
|
|
--spectrum-checkbox-m-text-color-error-down: FieldText;
|
|
--spectrum-checkbox-m-text-color-error-hover: FieldText;
|
|
--spectrum-checkbox-m-text-color-error: FieldText;
|
|
--spectrum-checkbox-m-text-color-hover: FieldText;
|
|
--spectrum-checkbox-m-text-color-key-focus: FieldText;
|
|
--spectrum-checkbox-m-text-color: FieldText;
|
|
&.is-invalid {
|
|
.spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color);
|
|
}
|
|
}
|
|
&.is-indeterminate .spectrum-Checkbox-box {
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color-error);
|
|
}
|
|
}
|
|
/* Extra-specific selectors added here to handle checked state */
|
|
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box
|
|
{
|
|
&:before {
|
|
border-color: var(--spectrum-checkbox-m-box-border-color-error);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|