diff --git a/api/js/etemplate/Et2Checkbox/Et2Checkbox.ts b/api/js/etemplate/Et2Checkbox/Et2Checkbox.ts index 3ad3dd41cf..4141f41966 100644 --- a/api/js/etemplate/Et2Checkbox/Et2Checkbox.ts +++ b/api/js/etemplate/Et2Checkbox/Et2Checkbox.ts @@ -28,25 +28,33 @@ export class Et2Checkbox extends Et2InputWidget(SlCheckbox) ...shoelace, ...super.styles, css` - :host { - /* Make it line up with the middle of surroundings */ - margin: auto 0px; - vertical-align: baseline; - } + :host { + /* Make it line up with the middle of surroundings */ + margin: auto 0px; + vertical-align: baseline; + } - :host([disabled]) { - display: initial; - } + :host([disabled]) { + display: initial; + } - /* Fix positioning */ - .checkbox { - position: relative; - } + /* Fix positioning */ - /* Extend hover highlight to label */ - .checkbox:not(.checkbox--disabled):hover { - color: var(--sl-input-border-color-hover); - } + .checkbox { + position: relative; + } + + /* Extend hover highlight to label */ + + .checkbox:not(.checkbox--disabled):hover { + color: var(--sl-input-border-color-hover); + } + + /* Use normal color even when required */ + + :host([required]) .checkbox__control { + color: var(--input-text-color); + } `, ]; }