Following the question How to implement switchable themes in scss? (especially the 2nd answer with ideas from this Medium post), I tried to implement themes through SASS on my project.
But I cannot make it work.
I created a stackblitz so that it is easier to explain and to see the problem:
On the main component, it is working as intended, switching theme in app.component.html (between theme-one and theme-two) changes the color of the <p>.
But on the sub-component (called <my-component>), the same rules are imported in the SASS file but it is not working there.
The underline rule (which is declared in the mixin) is seen, so it has been imported, but the colors are not changing when switching themes.
If I debug (in SASS using @debug), I can see that the colors are rightly fetched from the $theme-map, but it looks like they are not returned.
Is this a known issue linked to Angular encapsulation/scoping? Is there a way to make it work?