Skip to content

Limited precision for font sizes with relative units in the WordPress block editor #68599

@deryckoe

Description

@deryckoe

What problem does this address?

The WordPress Block Editor currently restricts REM values to two decimal places, automatically rounding any entered value to this limit. This restriction makes it impossible to use exact font sizes that require more precision. For example, a font size of 22px equals 1.375rem, but the editor forces users to round this to 1.37rem or 1.38rem, leading to inaccuracies.

This automatic modification limits user control and makes it difficult to maintain precise and consistent typography. It also forces users to use px units as a workaround, which is not ideal for responsive design.

Gg7ph2cXsAAm4be.mp4

What is your proposed solution?

Remove the automatic rounding of REM values in the WordPress Block Editor. Allow users to input REM values as they choose, without the editor modifying or rounding them. For example, if a user enters 1.375rem, it should be retained as-is, preserving the exact value.

This solution would provide users with the flexibility and precision needed to create pixel-perfect designs while adhering to best practices for responsive design.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions