• Resolved Samuel Mente

    (@samuelmente)


    Hey guys πŸ™‚
    I really like your plugin. I have one suggestion though:
    Currently our ATC-Styling was broken due to a line of css in your code. This is what it currently looks like with your plugin:

    This is what it should look like:

    The reason is, that in your file “/assets/css/frontend.min.css” you declare:

    .woocommerce-variation-add-to-cart, form.cart {
    flex-wrap: wrap !important;
    }

    This is way to broad and especially using the “!important” overwrites almost all styles. In its current form it applies to all products and is not limited to products that are actually using the product fields.

    A cleaner solution would be to use :has(), which now is supported in all major browsers for some time (https://caniuse.com/?search=has).
    Even better would be to only load the css-Sheet in the frontend for products that use the fields and don’t load it at all on other products.

    The :has()-Solution would look like this:

    .woocommerce-variation-add-to-cart:has(.wapf),
    form.cart:has(.wapf) {
    flex-wrap: nowrap !important;
    }

    This is my current solution:

    .woocommerce-variation-add-to-cart:not(:has(.wapf)),
    form.cart:not(:has(.wapf)) {
    flex-wrap: nowrap !important;
    }
Viewing 1 replies (of 1 total)
  • Plugin Author Wombat Plugins

    (@maartenbelmans)

    Hi @samuelmente

    It’s on our to-do list to change this to more modern CSS selectors like has, but the youngest release for that is Dec 2023, which is still a bit “too young”. It’s not 2 years old yet so we are waiting a bit.

    Sadly, the !important part is necessary because some themes overwrite the “add to cart” styling from WooCommerce and it would mean our form doesn’t look good.

    Your fix works until we update! πŸ™‚

Viewing 1 replies (of 1 total)

The topic ‘Important Style breaks Styling’ is closed to new replies.