CSS Font size best practice: PX vs REM?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 06:54 AM - edited 09-10-2024 06:59 AM
There has been a long standing discussion in our team, whether should we use px or rem for CSS in Service portal widgets.
I understand that we can define the base font size for a Portal in the service portal record. But what happens when the widget is used in many different portals?
If we want our widgets to appear and behave the same way in multiple portals, which one should we use REM or PX?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2024 04:24 AM
Hi @Prakhar7
Very interesting discussion.
In my opinion, REM is the way to go. For example, one of the advantages is that when you change the default font size for each template in multiple portals, it is automatically reflected on the widget side as well. On the other hand, it would require more time and effort to design the widget to accommodate the change in size, but I think REM is slightly preferable when accessibility is also considered.