Skip to content

Commit f314914

Browse files
committed
feat: improve accessibility and styling in SegmentedControl and ThemeSwitcher components
1 parent 224c682 commit f314914

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/Common/SegmentedControl/Segment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const Segment = ({
4545
name={name}
4646
onChange={handleChange}
4747
checked={isSelected}
48-
className="dc__opacity-0 m-0-imp dc__top-0 dc__left-0 dc__position-abs dc__bottom-0 dc__right-0 w-100 pointer h-100 dc__visibility-hidden"
48+
className="sr-only"
4949
disabled={disabled}
5050
/>
5151

src/Common/SegmentedControl/segmentedControl.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
--segmented-control-highlight-width: auto;
88
--segmented-control-highlight-x-position: 0;
99

10+
&:has(input[type='radio']:checked:focus-visible) {
11+
.segmented-control__segment--selected {
12+
outline: 2px solid var(--B500) !important;
13+
outline-offset: 2px;
14+
}
15+
}
16+
1017
&::before {
1118
content: '';
1219
background: var(--bg-primary);
@@ -39,7 +46,7 @@
3946
transition: color 0.3s ease;
4047

4148
&:hover:not(#{$parent-selector}--selected):not(.cursor-not-allowed) {
42-
background-color: var(--bg-secondary);
49+
background-color: var(--bg-hover);
4350
}
4451

4552
&--selected {

src/Shared/Components/ThemeSwitcher/ThemeSwitcher.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const ThemeSwitcher = ({ onChange }: ThemeSwitcherProps) => {
3232
<button
3333
type="button"
3434
data-testid="open-theme-switcher-dialog"
35-
className={`${LOGOUT_CARD_BASE_BUTTON_CLASS} dc__hover-n50`}
35+
className={`${LOGOUT_CARD_BASE_BUTTON_CLASS} dc__tab-focus dc__hover-n50`}
3636
onClick={handleShowThemeSwitcherDialog}
3737
>
3838
Theme

0 commit comments

Comments
 (0)