|
|
|
|
|
by codedokode
2563 days ago
|
|
A website that is maintained in a long term will be worked on by many people, and CSS will become quite large and complicated. So using the simple constructs like pixel units is better than using rems that create implicit dependence on main font size. This way there are less chances to break something in one place when editing code in other place. The same is about CSS variables. An example with one variable might look nice. But what if your code has hundreds of variables? It would take more time to understand how they are related and how do I change the size of this button without breaking something on another page. |
|
But now you have to keep all those relevant "main font sizes" in your head and do constant divisions. rem units give you the ratio directly.