I have simple code with SCSS code where is @extend within @media query.
SCSS complier gives me error on both of this variations:
VARIATION 1:
%dark-theme {
background: $dark-background;
}
%light-theme {
background: $light-background;
}
@media (prefers-color-scheme: light) {
body {
@extend %light-theme;
}
}
@media (prefers-color-scheme: dark) {
body {
@extend %dark-theme;
}
}
VARIATION 2
%dark-theme {
background: $dark-background;
}
%light-theme {
background: $light-background;
}
@media (prefers-color-scheme: light) {
@extend %light-theme;
}
@media (prefers-color-scheme: dark) {
@extend %dark-theme;
}
Is there any solution how I can do the @extend in basic element and also in @media query?