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
I really like svelte but there's one thing that gets on my nerves. I prefer creating my own components and not using a framework. When I want for example the border radius to be half of the height of the element, I have to manually create a JS function to calculate this.
Describe the proposed solution
I would like to have a custom css unit that is removed from CSS and added as a JS function which adds a style attribute. An example:
element {
border-radius:50rh;
}
That would mean half of the height of an element (rh for 'real height').
I imagine a compiled solution like this:
@adminy Thank you for your answer. That's a good solution. I've thought about any other use case for a unit like this but couldn't find one where it would be more elegant than with just normal CSS.
Describe the problem
I really like svelte but there's one thing that gets on my nerves. I prefer creating my own components and not using a framework. When I want for example the border radius to be half of the height of the element, I have to manually create a JS function to calculate this.
Describe the proposed solution
I would like to have a custom css unit that is removed from CSS and added as a JS function which adds a style attribute. An example:
That would mean half of the height of an element (rh for 'real height').
I imagine a compiled solution like this:
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: