Changing variation swatch colour background on hover

This topic has 5 replies, 2 voices, and was last updated 1 years, 5 months ago ago by Hassan

  • Avatar: Hassan
    Hassan
    Participant
    July 13, 2023 at 12:39

    Hi,

    The variation swatches only enable us to change the border colour instead of the background colour on hover/active.

    Is their any way we can change the background colour so when the user hovers and selects a variation, that it changes the colour of the swatch background so they know what they have selected?

    Many thanks

    4 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    July 13, 2023 at 12:50

    Hello, Hassan,

    Thank you for contacting us and for using XStore.

    Please try to use the next custom CSS code:

    ul.st-swatch-size-large li.type-label:hover,
    ul.st-swatch-size-normal li.type-label:hover {
        background-color: #1a387b;
        color: white;
    }

    Kind Regards,
    8theme team

    Avatar: Hassan
    Hassan
    Participant
    July 18, 2023 at 11:07

    Hi that code works great. However, how do we make the active button stick on the same colour? so the customer knows what they have selected.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    July 18, 2023 at 14:07

    Hello, Hassan,

    Thank you for your response.

    Please change previous code to:

    ul.st-swatch-size-large li.type-label:hover,
    ul.st-swatch-size-large li.selected,
    ul.st-swatch-size-normal li.type-label:hover,
    ul.st-swatch-size-normal li.selected  {
        background-color: #1a387b;
        color: white;
    }

    Kind Regards,
    8theme team

    Avatar: Hassan
    Hassan
    Participant
    July 19, 2023 at 12:47

    Hi Rose,

    This works a treat.

    You are awesome.

    Thanks for your help.

  • Viewing 5 results - 1 through 5 (of 5 total)

The issue related to '‘Changing variation swatch colour background on hover’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.