Hello,
I am trying to change a toggle’s background color according to its on/off state.
This doesn’t work:
:host{
–color-raised:blue;
}
.value.on{
–color-raised:red;
}
This doesn’t help neither:
.value{
–color-raised:blue;
}
.value.on{
–color-raised:red;
}
…and, yes, I’ve searched using the sidebar brought by F12!
You are using a long dash character (–
) instead of two dashes (--
), and .value.on
does not target the right element, this works:
:host{
--color-raised:blue;
}
:host.on{
--color-raised:red;
}
Actually I have two short dashes (I’ve just checked my code) but it seems that the copy-paste process to Firefox transformed them!
But thank you anyway!