Skip to content

ClayCSS: Support Document Font Size to be 62.5% or 10px for easier rem/em conversion #1318

@pat270

Description

@pat270

Issue from Slack Chat:

Hey, a question. Is there a reason for 1rem to be 16 and not 10px in Liferay 7.1 ga1 in the Classic Theme? (i know 16px is default but isn't 10px the best practice?)

you’d set font-size: 62.5%, then have 1rem map to 10px so the conversion is simpler, 2.4rem == 24px

Changing this outright in Atlas would break any theme currently extending it.

  1. We could create a function that returns a rem value based on the document's base font size and a pixel value. We would have to wrap every rem value we use in that function. We would also have to overwrite all Bootstrap 4 variables that use rem values with this new pattern. I'm also not sure if this will work 100%. I've done a limited test and it's working but there are probably edge cases.

  2. Another option is to provide a base 10px or 62.5% variable theme in the compatibility layer.

  3. The final option I can think of is to offer a third party variable theme with base 10px or 62.5%.

All 3 of these options will only provide support for Sass inside our themes. Any Sass provided by our widgets and other plugins will have to be customized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp: clay-cssIssues related to Clay CSStype: discussionIssues that are open for discussion of some change or to gather informationtype: enhancementIssues that are open to bring improvements or refinement of code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions