Archived topic
What is the correct way to target ALL Generate Press buttons
3 replies · Started by Mikko on December 21, 2020
Hi,
I'm trying to target all buttons on Generate Press.
Currently I'm using following selectors for "normal" state.
button, html input[type="button"], input[type="reset"], input[type="submit"], a.button, a.wp-block-button__link:not(.has-background) {
}
..and these for the other states.
button:hover, html input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover, a.button:hover, button:focus, html input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus, a.button:focus, a.wp-block-button__link:not(.has-background):active, a.wp-block-button__link:not(.has-background):focus, a.wp-block-button__link:not(.has-background):hover {
}
I feel that's awful lot of selectors so my question is what's the correct and most minimal way to target all buttons of Generate Press?
I tried "button" and "button:hover" but that doesn't apply to all buttons.
Thank you
Hi Mikko,
The current selector you are using is actually what I would recommend as there is not a single selector that covers all buttons.
If you aren't using any buttons block from WordPress then you can remove all the selectors with wp-block-button.
Let me know if this helps :)
Yes, I removed wp-block-button from my CSS so it's little bit leaner now. Thanks!
No problem :)