-
-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Allow attr
to override width
and height
#844
Labels
Comments
I was also disappointed when I tried to set the height from a CSS class with tailwind. :/ |
This works, but for height and width, so both.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe
I have a pretty specific scenario, but I think it's valid.
I want to set a default height of
1em
and width ofunset
. I need theunset
so when I override theheight
in certain specific cases, I don't have to also set the width to avoid the wrong aspect ratio. This package sets a default of1em
for both width and height (I think it should really only be height, like Font Awesome does in their default styles for inline SVGs). If I set these via aclassName
orstyle
onIconContext.Provider
, due to CSS specificity and the required order of my imports, when I need to override the size on a specific icon, I need to use!important
.Speaking more broadly, I'm a bit confused as to why the provider is the way it is. Couldn't
value
simply be of typeComponentProps<"svg">
, i.e. just accept any attributes that could go on an SVG element, includingstyle
,className
,color
(tofill: currentColor
),size
(toheight: 1em
) and everything else you currently have. Seems simpler and more straightforward. Then the user can always override anything there, no doubt. Maybe something to consider for the next major version...?Solution
As described in the title.
Minimal sample repository URL
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: