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 proposal] Background-image reset #436

Closed
illycz opened this issue Mar 26, 2018 · 9 comments
Closed

[Feature proposal] Background-image reset #436

illycz opened this issue Mar 26, 2018 · 9 comments

Comments

@illycz
Copy link

illycz commented Mar 26, 2018

For responsive variants would be useful something like .bg-none for background: transparent.

@illycz illycz changed the title Feature Request: Background-image reset [Feature proposal] Background-image reset Mar 26, 2018
@adamwathan
Copy link
Member

We actually do have bg-transparent already, do you need something different than that?

@hacknug
Copy link
Contributor

hacknug commented Apr 2, 2018

I agree it would make sense to have a utility for resetting the background-image of an element (plus it would have almost no impact on the file size).

My only issue with this would be that adding a new module just for this wouldn't make much sense and, since someone might need to define multiple background-images, this would be something a plugin should take care of.

@illycz
Copy link
Author

illycz commented Apr 3, 2018

@adamwathan bg-transparent does not reset background-image.

@hacknug
Copy link
Contributor

hacknug commented Apr 3, 2018

It doesn't but it does the exact same thing as background: transparent which you mentioned.

@illycz
Copy link
Author

illycz commented Apr 3, 2018

I don't thing so. Tailwinds .bg-transparent generate background-color: transparent which not remove background image. background: transparent remove background image.

@adamwathan
Copy link
Member

Coming back to this, can you give an example of usage? Do you have your own custom utilities for adding background images right now? If not, how are you adding background images that you want to remove with this class?

@nicolas-giuristante
Copy link

Here is an example, not an everyday problem but I wanted such a utility class myself:

I have an asymmetric layout with a background image :
bg-contain bg-right bg-no-repeat

On mobile, it's atrocious and would like to remove it, I could be able to use those responsively :
user-bg-id bg-black bg-image-none(figurative) lg:bg-contain lg:bg-right lg:bg-no-repeat

Where:
user-bg-id -> background-image { url(); }

Not sure if it makes sense nor if I'm correct with this approach, but that would just be useful. Otherwise I have to create it with media queries and such. 100% doable yet requires ugly custom CSS.

@4refael
Copy link

4refael commented Feb 2, 2019

I think bg-none can be useful, but for background-image: none and not for the suggested background: transparent.

@adamwathan
Copy link
Member

Since the only way for bg-none to work would be for you to implement all your custom background images as classes as well (inline styles will, or at least should, trump classes), going to close this as a "best done by the user if they need it" sort of thing.

It may be useful to explore adding a dedicated backgroundImage core plugin where you can provide URLs to your own background images but I think we can discuss that in a separate issue if people want it.

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

5 participants