Replies: 1 comment
-
You're welcome to create a PR, we can also use CSS variable to modify it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, the
@ngneat/svg-icon
library does not provide a built-in property to adjust the stroke width of SVG icons. This feature would be incredibly useful, as it would allow developers to use the same icon across different components with varying stroke widths, enhancing flexibility and reusability.Current Workaround and Limitations:
I attempted to remove the
stroke-width="2"
attribute from the SVG file and set the stroke width via CSS ({ stroke-width: 3 }
). However, this approach does not work as expected. The library seems to default the stroke width to 1, overriding any custom CSS styles. This limitation makes it difficult to dynamically adjust stroke widths based on different use cases.Proposed Solution:
It would be highly beneficial to introduce a property (e.g., strokeWidth) that allows developers to dynamically set the stroke width of SVG icons. This property could be passed as an input to the svg-icon component, enabling customization at the component level.
Example Usage:
Benefits:
Conclusion:
Adding support for adjustable stroke widths would greatly enhance the versatility of the @ngneat/svg-icon library, making it even more powerful for modern web development. I believe this feature would be a valuable addition for many developers using the library.
Thank you for considering this request! I look forward to hearing your thoughts.
Beta Was this translation helpful? Give feedback.
All reactions