Skip to content

Commit 6f86f64

Browse files
HDS-5666 Add comment explaining purpose of pseudo element for AccordionItem, refactor dark-themed nav interactive elements to use outline
1 parent 90e52ae commit 6f86f64

File tree

4 files changed

+62
-1958
lines changed

4 files changed

+62
-1958
lines changed

packages/components/src/styles/components/accordion.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138

139139
// entire toggle area is interactive
140140
.hds-accordion-item__button--parent-does-not-contain-interactive {
141+
// Pseudo element is used to make entire AccordionItemToggle area interactive (vs. just its nested button) and to style the focus ring accordingly
141142
@include hds-focus-ring-with-pseudo-element(
142143
$top: var(--hds-accordion-item-focus-ring-offset),
143144
$right: var(--hds-accordion-item-focus-ring-offset),

packages/components/src/styles/mixins/_interactive-dark-theme.scss

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ $hds-interactive-dark-theme-focus-ring-action-box-shadow:
1515

1616
// Used to apply dark theme to interactive elements such as Button & Dropdown
1717
@mixin hds-interactive-dark-theme($add-visible-border: true, $is-within-side-nav: false) {
18-
// Override token used in focus ring mixin
19-
--token-focus-ring-action-box-shadow: #{$hds-interactive-dark-theme-focus-ring-action-box-shadow};
20-
2118
// Default:
2219
border: 1px solid transparent;
2320
cursor: pointer;
@@ -59,25 +56,11 @@ $hds-interactive-dark-theme-focus-ring-action-box-shadow:
5956
// Focus:
6057
&:focus,
6158
&.mock-focus {
62-
@include hds-focus-ring-with-pseudo-element($top: -1px, $right: -1px, $bottom: -1px, $left: -1px);
63-
6459
color: var(--token-color-foreground-high-contrast);
6560
background-color: var(--token-color-palette-neutral-700);
66-
67-
@if ($add-visible-border) {
68-
border-color: $hds-interactive-dark-theme-color-focus-action-internal;
69-
}
70-
71-
// focus ring:
72-
&::before {
73-
color: var(--token-color-foreground-high-contrast);
74-
border: none;
75-
}
76-
}
77-
78-
// override style removing the focus style
79-
&:focus:focus:not(:focus-visible)::before {
80-
box-shadow: $hds-interactive-dark-theme-focus-ring-action-box-shadow;
61+
border-color: $hds-interactive-dark-theme-color-focus-action-internal;
62+
outline: 3px solid #{$hds-interactive-dark-theme-color-focus-action-external};
63+
outline-offset: 0; // override Primary button variant offset
8164
}
8265

8366
// Active:

0 commit comments

Comments
 (0)