Every time you are using props in Styled-Components you are creating another a complete clone of all the defined styles plus the change. Tons of duplicate code for nothing, this is the opposite what the logic to use CSS variables instead of props!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This approach still creates duplicate CSS for every prop change...with duplicate variables.. this saves nothing.
A better approach would be to use
style
attribute to do the variables change:dev.to/terrierscript/tips-css-vari...
Here's a screenshot that shows this folly:
monosnap.com/file/JE19V30V2mfkuCci...
Every time you are using
props
in Styled-Components you are creating another a complete clone of all the defined styles plus the change. Tons of duplicate code for nothing, this is the opposite what the logic to use CSS variables instead of props!