I have a simple SCSS structure like the following:
nav.main {
a.close {
svg {
fill: black;
}
}
}
I'm then wanting to change the fill property to black if the data theme attribute on nav.main
is set to light
.
I'm a big fan of nesting and keeping things 'compact' so ideally I'd want to do something like the below, but unfortunately through all my different combinations I can't work out if it's possible. Ideally I'd prefer not to have to type out a.close
and svg
and use the nesting.
I come up against this all the time and always have break out of the nest.
nav.main {
a.close {
svg {
fill: black;
@at-root [data-theme="light"]#{&} {
// nav.main[data-theme="light"] a.close svg
fill: white;
}
}
}
}