Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Units in Angular Material - why px not rem / em

I have a question:

Recently I see a direction in CSS frameworks to switch to rems/ems (Bootstrap 4 went this way, Semantic UI has it as well). I really like this approach as it is really easy to scale "application/components size" with roots font-size or with browser default font size.

Do you know why Angular Material does not use it? I see, (almost) everything is in px. I guess approach with relative units is much better, more powerful, and does not create issues

like image 918
dragonfly Avatar asked Mar 02 '18 07:03

dragonfly


1 Answers

To quote jelbourn from the Angular team:

We don't use em or rem because we have no control over the context that influences the final size. However, with the typography extension to theming, you should be able to customize the styles to use a custom size.

Source: https://github.com/angular/material2/issues/5299#issuecomment-313743595

Not really detailed, but at least an answer ;)

like image 196
conceptdeluxe Avatar answered Nov 06 '22 22:11

conceptdeluxe