I would like to offer the user the option to choose the font-size of the whole app on his own. My problem is that I don't know how to change the font-size globally on runtime. I already tried adding a class in global.css:
...
* {
font-size: large; //that works
}
...
.large-font {
font-size: large; //that doesn't work
...
but that didn't work because I also don't know which are the actual HTMLElements, of which the font-size has to be changed.
This is the current version of my function for the (ionChange)-Event:
onSelectFontSize() {
const app = Array.from(
document.querySelectorAll('*') as unknown as HTMLCollectionOf<HTMLElement>
);
console.log('app: ', app);
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < app.length; i++) {
app[i].style.setProperty('font-size', '96px !important');
}
}
I am working with ionic 6 + Angular 14 with almost 2 months of experience in these technologies. I have already tried other solutions here in stack overflow.
Thank you in advance