single_add_to_cart_button :before & :after issues with WP Rocket Used CSS
-
Is there a reason why the add to cart button “single_add_to_cart_button” on single product page needs a :before & :after absolute styling? When using the optimize CSS feature with WP Rocket it’s creating an issue with where the :before absolute ends up covering the whole options section. When a user goes to select an option it acts like it’s selecting the add to cart button. Is it detrimental to hide these (display: none)?
Hello,
before and after are needed for the loader. after is the loader itself, before hides the standard text while the loader is running. If, for some reason, they go outside the button, it means the button has lost the relative position, which should always be there by default.
Kind Regards
So if we’re not using the preloader feature then making them display:none should be fine, correct?
Yes, you can try to simply hide these elements if you don’t need to see the loader during AJAX add to cart.