Change button background reset in Preflight
#1222
Merged
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.
The reason for this proposal is selfish: my
tailwindcss-resetplugin changes the defaultbackground-positionandbackground-repeaton all elements to more commonly used values (center centerandno-repeat), but I just realized that it doesn't work on<button>elements because of this declaration in Preflight, which comes from SUIT CSS (here's the commit that introduced this feature, for reference). Because thebackgroundshorthand is used instead ofbackground-color, it also resetsbackground-positionandbackground-repeat(among other background properties) to their default value and even though my declarations appear later in the CSS, they are overridden since they have no specificity. I believe a possible reason why they usedbackgroundinstead ofbackground-coloris to also resetbackground-imagetonone, since on some browsers such as old versions of Firefox for Android, buttons have a gradientbackground-imageby default. So I suggest replacingbackground: transparentby two declarations:background-color: transparentandbackground-image: none, just in case. Being more explicit is always better, right? 😅