Skip to content

fix(button): solve focus variant color issues#165

Merged
mlmoravek merged 1 commit intooruga-ui:mainfrom
whiplashwebb:bug/focus-visible
May 7, 2025
Merged

fix(button): solve focus variant color issues#165
mlmoravek merged 1 commit intooruga-ui:mainfrom
whiplashwebb:bug/focus-visible

Conversation

@whiplashwebb
Copy link
Copy Markdown
Contributor

This PR addresses a few minor bugs with button focus states

Focus vs Focus-Visible

Bulma prior to 1.0 uses :focus to control the focus ring on buttons but 1.0 switches to using :focus-visible. Theme-bulma has long overridden this focus style, but we didn't switch the override to focus-visible when we added support for Bulma 1.0. The result is the focus ring is a different color depending on how it is focused.

Screen.Recording.2025-03-31.at.2.23.06.PM.mov

Blue border with keyboard focus

The other issue is that our override misses the blue border coming from Bulma.

Screen.Recording.2025-03-31.at.3.18.18.PM.mov

The fix

This PR removes the :focus override completely, along with related variables. Instead, it sets the focus-* css variables to button colors. The resulting focus ring is identical but now flows through Bulma's focus-visible code so there's no mis-match. This also sets the border color.

@mlmoravek mlmoravek changed the title Button focus bugs fix(button): solve focus issues May 5, 2025
@mlmoravek mlmoravek added the bug Something isn't working label May 5, 2025
@mlmoravek mlmoravek changed the title fix(button): solve focus issues fix(button): solve focus variant color issues May 5, 2025
@mlmoravek mlmoravek merged commit 729cf15 into oruga-ui:main May 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants