Skip to content

Commit

Permalink
fix(kit): redesign focus to focus-visible in TuiAccordion (#7285)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlufy authored Apr 22, 2024
1 parent 86b694c commit 1357f78
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion projects/core/styles/theme/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
--tui-base-07: #ededed;
--tui-base-08: #f6f6f6;
--tui-base-09: #fff;
--tui-focus: rgba(51, 51, 51, 0.64);
--tui-focus: rgba(255, 255, 255, 0.64);
--tui-secondary: rgba(255, 255, 255, 0.16);
--tui-secondary-hover: rgba(255, 255, 255, 0.24);
--tui-secondary-active: rgba(255, 255, 255, 0.4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ export class TuiAccordionItemComponent
this.updateFocused(focused);
}

onFocusVisible(focusVisible: boolean): void {
this.updateFocusVisible(focusVisible);
}

onRowToggle(): void {
if (!this.disabled) {
this.updateOpen(!this.open);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
:host[data-mode='onLight'] & {
border-color: var(--tui-text-01);
}

:host._focus-visible & {
border: 2px solid var(--tui-focus);
}
}

:host:not([data-mode]) & {
Expand All @@ -84,6 +80,10 @@
text-align: left;
outline: none;

&:focus-visible {
box-shadow: inset 0 0 0 2px var(--tui-focus);
}

:host[data-mode='onDark'] & {
color: var(--tui-text-01-night);
border-color: var(--tui-base-03);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
(click)="onRowToggle()"
(keydown.esc)="onItemKeyDownEsc($event)"
(tuiFocusedChange)="onFocused($event)"
(tuiFocusVisibleChange)="onFocusVisible($event)"
>
<span
automation-id="tui-accordion__item-title"
Expand Down

0 comments on commit 1357f78

Please sign in to comment.