Skip to content

Conversation

@benface
Copy link
Contributor

@benface benface commented Nov 13, 2019

The reason for this proposal is selfish: my tailwindcss-reset plugin changes the default background-position and background-repeat on all elements to more commonly used values (center center and no-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 the background shorthand is used instead of background-color, it also resets background-position and background-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 used background instead of background-color is to also reset background-image to none, since on some browsers such as old versions of Firefox for Android, buttons have a gradient background-image by default. So I suggest replacing background: transparent by two declarations: background-color: transparent and background-image: none, just in case. Being more explicit is always better, right? 😅

@adamwathan adamwathan changed the base branch from master to v2 December 25, 2019 18:52
@adamwathan adamwathan merged commit 32e5ed9 into tailwindlabs:v2 Dec 25, 2019
@adamwathan
Copy link
Member

Thanks, this seems fine 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants