On Ionic v4 I have tried to define it into variables.scss inside root and then use it into scss page files but the compilations fails because it not found the mixins
If I define the mixins in each scss page file it works correctly
Where should be defined this ‘global’ mixins to can use on each page scss?
As far as I saw you would have to import the mixin in every scss where you would like to use it. Maybe I’m wrong but didn’t found any other solutions so far.
I have defined a custom fonts scss file that import the mixins file and create custom definitions. Then on each scss page file import this dedicated fonts scss file.
Another bizarre design decision from the Ionic team that goes against the principle of least astonishment. Anyone who has used SASS before would expect the mixins they write to be globally available in the remainder of the stylesheets. I’ve just spent 30 minutes trying to simply use a mixin only to find that that doesn’t work on Ionic 4 (although it did work in Ionic 3)
i declare them separately in a own .scss file, but them i have to import them in in the scss Files, where i want to use them. I think this is the normal way since ionic 4
that’s what I found and what I’m doing but still not the best solution. Not sure if this is because Ionic or Angular. Do you know if happens the same using React/Vue with Ionic?