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

[Feature Request] add background-repeat declaration to custom reset styles #725

Closed
sandren opened this issue Mar 7, 2019 · 1 comment
Closed

Comments

@sandren
Copy link

sandren commented Mar 7, 2019

While we may have recently added Normalize CSS as a formal dependency, I still think it is worth evaluating the merits of best practices evolving outside of it. Something to consider is the motivation behind the new CSS Remedy project. It is seeking to create a base stylesheet that:

sets CSS properties or values to what they would be if the CSSWG were creating the CSS today, from scratch, and didn't have to worry about backwards compatibility

I think the historical default value of the background-repeat property is a perfect example of this. While repeating patterns may have been common in the early web, they are now the exception, not the norm. As such I think we should consider changing preflight's custom reset styles to include the universal removal of background repetition.

*,
*::before,
*::after {
  background-repeat: no-repeat;
  border-width: 0;
  border-style: solid;
  border-color: config('borderColors.default', currentColor);
}
@adamwathan
Copy link
Member

Ended up releasing v1 without really digging in to this and don't want to add it since it would be a breaking change, so for now best bet is to add this to your own base styles if you want this behavior by default.

Reasonable reasons not to make this change:

  • It's still fairly common to use repeating backgrounds, I just used a repeating background for the Tailwind docs site actually
  • It could have surprising unwanted effects on third-party libraries that expect things to repeat by default. Our existing border reset messes up some stuff in Google Maps for example which is already a bummer.

Agree in principal that it's nicer to add bg-repeat to make something repeat than it is to add bg-no-repeat to undo default browser behavior, just don't want to make the breaking change.

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

No branches or pull requests

2 participants