S
S
Sergey Shilov2018-06-05 13:54:04
css
Sergey Shilov, 2018-06-05 13:54:04

How to manage variables on hover in scss?

Good afternoon! I didn’t find any information in Google, I need it to change its background from a predefined array of colors when hovering over the button.
Has anyone done something similar already?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
SagePtr, 2018-06-05
@Olivoin

What can't be done with CSS can't be done with SCSS.
CSS does not allow you to select a random attribute from the list, here you can’t do without JS.

V
Vitaly, 2018-06-05
@rim89

Usually this is done at the JavaScript level.

R
Roman Chasovitin, 2018-06-05
@RomanChasovitin

$primary: blue;
$second: green;

button{
  background-color: $primary;
  &:hover{
    background-color: $second;
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question