Skip to content

Commit be0debb

Browse files
authored
style(input): remove hover effect when label is hovered (#4196)
1 parent 51f90be commit be0debb

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.changeset/kind-pugs-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@digdir/designsystemet-css": patch
3+
---
4+
5+
**input**: Remove hover effect when `<label>` is hovered

packages/css/src/input.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
5656
@composes ds-print-preserve from './base.css';
5757
@composes ds-focus from './base.css';
5858

59-
&:not(:focus-visible, :disabled, [readonly]):hover {
59+
/* only hover effect on input, but with label if it is a radio or checkbox */
60+
:has(label):not(:has(label:hover)) &:not(:focus-visible, :disabled, :read-only):hover,
61+
&:read-only:not(:focus-visible, :disabled, [readonly]):hover {
6062
outline-color: var(--dsc-input-outline-color--hover);
6163
outline-width: var(--dsc-input-outline-width--hover);
6264
outline-style: var(--dsc-input-outline-style--hover);

0 commit comments

Comments
 (0)