Jos
Jos

Reputation: 310

my scss code is not properly nested

I'm having a hard time getting this working correctly in sass. Who can point me out what I'm doing wrong?

.label-info {
    background-color: red;
    border-radius: 1rem;

    & :hover {
        background-color: pink;
    }
}

That doesn't work, the hover doesn't work.

.label-info {
    background-color: red;
    border-radius: 1rem;
}
.label-info:hover {
    background-color: pink;
}

This works, but that's not scss. how do I nest this correctly?

Upvotes: 1

Views: 22

Answers (1)

J Livengood
J Livengood

Reputation: 2738

The space is messing it up- updated works for me:

&:hover {
    background-color: pink;
}

Upvotes: 2

Related Questions