Skip to content

Commit

Permalink
[Select] 🐛 Focus-border no longer cancels out error-border. (#3465)
Browse files Browse the repository at this point in the history
* 🐛 Focus-border no longer cancels out error-border.

* ♻️ Optimize CSS selectors, fix textarea

* 📝 Changeset
  • Loading branch information
KenAJoh authored Dec 19, 2024
1 parent 38f5e63 commit 0017789
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/late-turkeys-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": patch
---

Select: :bug: Focus-border no longer cancels out error-border.
5 changes: 5 additions & 0 deletions .changeset/young-goats-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": patch
---

Textarea: :bug: Focus-border no longer cancels out error-border.
6 changes: 5 additions & 1 deletion @navikt/core/css/form/select.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@
/**
Error handling
*/
.navds-select--error > * select:not(:hover, :focus, :disabled) {
.navds-select--error > * .navds-select__input:not(:hover, :disabled) {
box-shadow: 0 0 0 1px var(--ac-select-error-border, var(--a-surface-danger));
border-color: var(--ac-select-error-border, var(--a-surface-danger));
}

.navds-select--error .navds-select__input:focus {
box-shadow: var(--a-shadow-focus);
}

/**
Disabled
*/
Expand Down
9 changes: 3 additions & 6 deletions @navikt/core/css/form/textarea.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,13 @@
/**
Error handling
*/
.navds-textarea--error .navds-textarea__input:not(:hover, :focus-visible, :disabled) {
.navds-textarea--error .navds-textarea__input:not(:hover, :disabled) {
box-shadow: 0 0 0 1px var(--ac-textarea-error-border, var(--__ac-textarea-error-border, var(--a-border-danger)));
border-color: var(--ac-textarea-error-border, var(--__ac-textarea-error-border, var(--a-border-danger)));
}

@supports not selector(:focus-visible) {
.navds-textarea--error .navds-textarea__input:not(:hover, :focus, :disabled) {
box-shadow: 0 0 0 1px var(--ac-textarea-error-border, var(--__ac-textarea-error-border, var(--a-border-danger)));
border-color: var(--ac-textarea-error-border, var(--__ac-textarea-error-border, var(--a-border-danger)));
}
.navds-textarea--error .navds-textarea__input:focus-visible {
box-shadow: var(--a-shadow-focus);
}

.navds-textarea__input:disabled {
Expand Down

0 comments on commit 0017789

Please sign in to comment.