Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💄 Focus-visible #1966

Merged
merged 13 commits into from
May 10, 2023
Prev Previous commit
Next Next commit
🎨 Helptext
  • Loading branch information
KenAJoh committed May 10, 2023
commit fdd81cb73ddbe7f0764a6e0e9298a945825cd80e
1 change: 1 addition & 0 deletions @navikt/core/css/expansioncard.css
Original file line number Diff line number Diff line change
@@ -124,6 +124,7 @@
}

.navds-expansioncard__header-button:focus-visible {
outline: none;
box-shadow: var(--a-shadow-focus);
}

24 changes: 20 additions & 4 deletions @navikt/core/css/help-text.css
Original file line number Diff line number Diff line change
@@ -12,11 +12,17 @@
font-size: 1.5rem;
}

.navds-help-text__button:focus {
outline: none;
.navds-help-text__button:focus-visible {
box-shadow: 0 0 0 1px var(--a-surface-default), 0 0 0 4px var(--a-border-focus);
}

@supports not selector(:focus-visible) {
.navds-help-text__button:focus {
outline: none;
box-shadow: 0 0 0 1px var(--a-surface-default), 0 0 0 4px var(--a-border-focus);
}
}

.navds-help-text__icon {
border-radius: var(--a-border-radius-full);
}
@@ -36,10 +42,20 @@
display: none;
}

.navds-help-text__button:where(:hover, :focus, [aria-expanded="true"]) > .navds-help-text__icon {
.navds-help-text__button:where(:hover, :focus-visible, [aria-expanded="true"]) > .navds-help-text__icon {
display: none;
}

.navds-help-text__button:where(:hover, :focus, [aria-expanded="true"]) > .navds-help-text__icon--filled {
.navds-help-text__button:where(:hover, :focus-visible, [aria-expanded="true"]) > .navds-help-text__icon--filled {
display: inherit;
}

@supports not selector(:focus-visible) {
.navds-help-text__button:where(:focus) > .navds-help-text__icon {
display: none;
}

.navds-help-text__button:where(:focus) > .navds-help-text__icon--filled {
display: inherit;
}
}