Skip to content
This repository was archived by the owner on Aug 11, 2026. It is now read-only.
This repository was archived by the owner on Aug 11, 2026. It is now read-only.

Small values like 1px should remain as px units and not be converted to rem by pxtorem #4776

Description

@aveline

This issue proposes that small values, ranging from 1px to 4px, should be set in px rather than rem as they are most commonly used for things like borders, which should render consistently regardless of any user adjustments to browser font size.

The range is up for discussion, I thought 1px to 4px would make sense, but we can increase the range.

In Firefox if the user increases the browser font size, border width will scale if set to rem, but in Chrome and Safari border width doesn't seem to scale if set to rem.

Border width set in rem and large browser font size

Screen Shot 2022-01-12 at 12 36 00 PM Screen Shot 2022-01-12 at 12 41 55 PM Screen Shot 2022-01-12 at 12 42 13 PM
Firefox (border width is heavier) Chrome Safari

Border width set in px and large browser font size

Screen Shot 2022-01-12 at 12 39 02 PM
Firefox

In all 3 browsers, border-radius will scale if set in rem.

Computed border-radius in Chrome when set in rem

Screen Shot 2022-01-12 at 12 05 01 PM Screen Shot 2022-01-12 at 12 04 33 PM Screen Shot 2022-01-12 at 12 16 56 PM
Default font size Very large font size Very small font size

Should border radius scale depending on user set browser font size or remain constant? In which case we should also render them in px rather than rem.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions