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

Tabs highlight in mobile #182

Open
bembelimen opened this issue Jul 31, 2021 · 1 comment
Open

Tabs highlight in mobile #182

bembelimen opened this issue Jul 31, 2021 · 1 comment

Comments

@bembelimen
Copy link
Contributor

On mobile view the tabs morph very nice to a stacked view. I found one issue: When you open a tab by clicking it, it becoms a highlight with the :after pseudo-tag:

grafik

But when you click again to close it, the highlight stays (as the aria-expanded="true" is not removed)

CC @dgrammatiko for the knowledge
CC @chmst for accessibility

@dgrammatiko
Copy link
Collaborator

dgrammatiko commented Jul 31, 2021

But when you click again to close it, the highlight stays (as the aria-expanded="true" is not removed)

This is tricky, the state is reflected/synced to the aria-selected so removing it means we can't reopen the pane. Also minimizing the pane and then resizing to reveal the tabs we have to select a tab (again from aria-selected). In short, the accordion buttons probably should use a class for the selected state or a combo that checks if the next element is hidden (I prefer this as it's only css changes)

This works for all except the first one :(

joomla-tab-element:not([active]) ~ button[aria-expanded="true"]::after {
  all: inherit;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants