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

5.2.1 broke .btn:focus box-shadow behaviour #37106

Closed
3 tasks done
oakleaf opened this issue Sep 8, 2022 · 4 comments
Closed
3 tasks done

5.2.1 broke .btn:focus box-shadow behaviour #37106

oakleaf opened this issue Sep 8, 2022 · 4 comments
Labels

Comments

@oakleaf
Copy link

oakleaf commented Sep 8, 2022

Prerequisites

Describe the issue

Upgraded from 5.2.0 and quickly noticed that the box-shadow disappeared from all my buttons when :focus(ing).

The options (https://getbootstrap.com/docs/5.2/customize/options/) clearly states;
$enable-shadows | true or false (default) | Enables predefined decorative box-shadow styles on various components. Does not affect box-shadows used for focus states.

Could this be the issue?
https://github.com/twbs/bootstrap/blob/main/scss/_buttons.scss

#21, the "--#{$prefix}btn-focus-shadow-rgb" variable doesnt seem to exist

Reduced test cases

https://github.com/twbs/bootstrap/blob/main/scss/_buttons.scss

#21, add default value to
--#{$prefix}btn-focus-shadow-rgb

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

v5.2.1

@julien-deramond
Copy link
Member

Isn't your issue linked to the following modification #37026?

for all .btns, it changes the :focus styling to :focus-visible - this way, the focus style doesn't take effect and "stick" (until you click somewhere else) for mouse/touch users

When you're talking about ":focus(ing)`, is it focusing with the mouse or the keyboard (or both)?

@oakleaf
Copy link
Author

oakleaf commented Sep 8, 2022

Okey, sorry - was not aware that the :focus was removed. Are there any solution to bring it back? We love the focus-shadows.

@julien-deramond
Copy link
Member

I'm closing it since the issue seems to be resolved.

Are there any solution to bring it back? We love the focus-shadows.

You'll have to create your own :focus rules to override the behavior offered by our rules linked to :focus-visible. Here is the corresponding diff: https://github.com/twbs/bootstrap/pull/37026/files.

@julien-deramond julien-deramond closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2022
@daftspunk
Copy link

daftspunk commented Sep 9, 2022

You'll have to create your own :focus rules to override the behavior offered by our rules

Super simple example for restoring the focus ring thing:

.btn:focus {
    box-shadow: 0 0 0 0.25rem rgb(97 109 133 / 50%);
}

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

No branches or pull requests

3 participants