I introduced styled-components as a cleaner alternative to introduce custom CSS styling for components. However, I really dislike the verbosity and duplicated information when paired with TypeScript.
styled-components seems really great as a custom design system from the ground up. However, because of the heavy TailwindCSS use, most of the powerful features styled-components provides are completely unnecessary.
Most of the verbosity stems from TypeScript. styled-components requires two separate typings, one for typing props that will be added to the component directly (such as adding to className) and one for the template literals. I am sure the code would be much cleaner in a vanilla JS environment
I really dislike the lambdas to access the props.
I will slowly be converting these back to normal components.
They are not actually any shorter, nor do I think they look much cleaner. In fact, I almost prefer how styed-components look. But they are much less annoying.
I introduced
styled-components
as a cleaner alternative to introduce custom CSS styling for components. However, I really dislike the verbosity and duplicated information when paired with TypeScript.styled-components
seems really great as a custom design system from the ground up. However, because of the heavy TailwindCSS use, most of the powerful featuresstyled-components
provides are completely unnecessary.Most of the verbosity stems from TypeScript.
styled-components
requires two separate typings, one for typing props that will be added to the component directly (such as adding toclassName
) and one for the template literals. I am sure the code would be much cleaner in a vanilla JS environmentI really dislike the lambdas to access the props.
I will slowly be converting these back to normal components.
They are not actually any shorter, nor do I think they look much cleaner. In fact, I almost prefer how
styed-components
look. But they are much less annoying.➡️➡️