Skip to content

Coherent default for focus box in select #41284

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

madbob
Copy link

@madbob madbob commented Mar 10, 2025

Description

Change default setting for $form-select-focus-box-shadow.

Motivation & Context

$form-select-focus-box-shadow doesn't fallback on common settings about focus boxes, and has a different behavior when applying customizations described in the documentation (just setting $focus-ring-box-shadow does not impact on select boxes).

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

This is actually a breaking change, as it alters an established behavior (even if wrong).

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Live previews

`$form-select-focus-box-shadow` doesn't fallback on common settings about focus boxes, and has a different behavior when applying settings descripted [in the documentation](https://getbootstrap.com/docs/5.3/helpers/focus-ring/#sass-variables) (just setting `$focus-ring-box-shadow` does not impact on select boxes).
@madbob madbob requested a review from a team as a code owner March 10, 2025 16:35
@mdo mdo added this to v5.3.6 Apr 6, 2025
@github-project-automation github-project-automation bot moved this to To do in v5.3.6 Apr 6, 2025
Copy link
Member

@mdo mdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems safe since the line has been unchanged since #28450.

@mdo
Copy link
Member

mdo commented Apr 6, 2025

Oh hmm, this does cause errors with $form-select-focus-width being unused. Unsure how I'd want to tackle yet.

@madbob madbob requested a review from a team as a code owner April 6, 2025 23:20
@madbob
Copy link
Author

madbob commented Apr 6, 2025

Oops... My fault, I just looked to the output of npm run lint without the necessary attention.

Removing both the unused variables ($input-btn-focus-color and $form-select-focus-width) seems to have no side effects.

More in general, I feel that all the $input-btn-focus-* variables are just aliases for $focus-ring-* and should be suppressed. $btn-focus-* already permit customization of buttons over inputs and can be defaulted directly to $focus-ring-*, like in a few other situations.

My proposal: fix the behavior of select with this PR (or a new, clean one, as I messed a bit around trying to loosely sync my branch...), and dive a bit deeper to remove some other redundant variable.

@mdo
Copy link
Member

mdo commented Apr 7, 2025

Yeah there are too many reused variables, so that's a thing I'm working on in v6. Need to reduce these things down a bit. As for this branch, we could mark those other variables as deprecated here and merge this, but I'd need @julien-deramond's thoughts on that.

@julien-deramond
Copy link
Member

As for this branch, we could mark those other variables as deprecated here and merge this

Hey!
I’ve added this commit to retain the Sass variables and mark them as deprecated using fusv, following the approach we've used so far.

Since this would introduce breaking changes, we’ll need to hold off on merging the PR until v5.4.0 to avoid issues in a patch release.
I’ve moved this PR to the v5.4.0 project.

@github-project-automation github-project-automation bot moved this to Needs review in v5.4.0 Apr 7, 2025
@julien-deramond julien-deramond moved this from Needs review to Review in progress in v5.4.0 Apr 7, 2025
@julien-deramond julien-deramond removed this from v5.3.6 Apr 7, 2025
@julien-deramond julien-deramond moved this from Review in progress to Ready to merge in v5.4.0 Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready to merge
Development

Successfully merging this pull request may close these issues.

3 participants