• Resolved pinksharpii

    (@pinksharpii)


    I see in woocommerce.css there are several CSS variables used for color definitions. I can override them in my theme of course, by doing something like:

    :root {
        --wc-blue: #8ed1fc;
    }

    But that doesn’t actually do anything because Woocommerce elements are still hard coded to specific hex codes like this:

    .woocommerce-info {
        border-top-color: #1e85be;
    }

    It would be fantastic if the Woocommerce team could rewrite woocommerce.css to actually use the variables that are declared at the beginning of the file so they can easily be overridden by themes. I have seen other plugins do this recently. Honestly, I’m not sure the purpose of having those variables declared in the CSS if they’re not ever used or overriddable.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi! Yes, there is this case, the reason is that the WooCommerce development team applies this color scheme based on the storefront, and of course they are also used in parts of the back office, but it is a very good point that this process should be the same.

    Plugin Support hrn1995 (woo-hc)

    (@aguinaldodarla)

    Hi @pinksharpii

    We appreciate your feedback and understand your concerns regarding the use of CSS variables in WooCommerce.

    The CSS variables declared at the beginning of the file are used for our default styling. @yazdaniwp is right. Also, the reason behind this is to ensure that WooCommerce maintains a consistent look and feel across different themes. However, we understand that this might not be ideal for everyone, especially for those who want to customize their store to match their branding.

    You may find our documentation helpful below on how to override WooCommerce styles:
    Disabling WooCommerce styles

    Please note that we can’t provide support for code customization as per our support policy. Still, if you need customization, we do our best to offer advice and direct you to appropriate resources. Based on the feedback we get from our customers, we highly recommend contacting one of the services on our Customization page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WC defined CSS variables aren’t actually used’ is closed to new replies.