Add no-spinners utility to remove input spinners #41355
Closed
+30
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a new utility class .no-spinners to remove spinners
from number inputs. Includes visual test in tests/visual/no-spinners.html
and documentation in docs/5.3/utilities/misc.md. Implemented via
a separate _no-spinners.scss file due to utilities API limitations
with pseudo-elements like ::-webkit-inner-spin-button.
Description
This pull request introduces a new utility class, .no-spinners, to the
Bootstrap framework. The purpose of this utility is to remove the spinner
arrows (increment/decrement controls) from
elements and similar input types across supported browsers, providing a
cleaner visual appearance while preserving the input's numeric functionality.
Motivation & Context
This change is required to address a common customization need in web
development: removing the spinner arrows (increment/decrement controls)
from elements and similar input types. Bootstrap
currently lacks a built-in utility to control this aspect of form inputs, leaving
developers to implement custom CSS outside the framework. By adding the
.no-spinners utility, Bootstrap provides a standardized, reusable solution that
aligns with its philosophy of offering flexible, ready-to-use utilities for
common styling tasks. This enhances the framework’s utility suite, reduces
the need for external overrides, and ensures consistency across projects that
rely on Bootstrap.
The .no-spinners utility solves several problems faced by developers:
Type of changes
Checklist
npm run lint
)Live previews
Related issues
This pull request addresses a recurring need in the Bootstrap community for controlling the appearance of spinner arrows in
<input type="number">
elements. Below are some related issues and discussions from the Bootstrap GitHub repository:Issue input[type="number"] not displaying properly in Chrome #8350:
input[type="number"]
not displaying properly in Chrome (Opened June 29, 2013)<input type="number">
rendering, including spinner visibility issues in Chrome. A suggested fix involved CSS targeting::-webkit-outer-spin-button
and::-webkit-inner-spin-button
, similar to this PR’s approach.Issue Spinner inside input #28600: Spinner inside input (Opened April 1, 2019)
General Community Feedback: Frequent discussions on Stack Overflow and forums highlight the need for spinner removal, often using custom CSS. This PR formalizes that solution within Bootstrap.