You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.mp4video4.mp4video6.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.
Problem
Some component libraries have a
Sizeproperty 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
remwhich means you can't freely scale up a component.Demonstration
Here are some videos of me changing the
font-sizeof 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
remwithemand make the icons scale.Mock-up:
video2.mp4