Skip to content

Scaling components via font size #62

@danielchalmers

Description

@danielchalmers

Problem

Some component libraries have a Size property that scales the component using manual inputs, usually pixels, but I recently worked on overhauling a component to scale via relative units and thought I should put the idea out there!

PureBlazor uses relative units all over the place, which is awesome, but they are typically rem which means you can't freely scale up a component.

Demonstration

Here are some videos of me changing the font-size of a component (not the text):

video5.mp4
video4.mp4
video6.mp4

The icons and margins don't scale with the font size.

Suggestion

There isn't necessarily a right or wrong way of doing this, but there is some utility in being able to scale up a component to your own size. This might remove the need for a custom sizing system altogether and thus pre-emptively simplify the code.

You could replace some cases of rem with em and make the icons scale.

Mock-up:

video2.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    dnadesign and architecture neededenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions