Tailwind-Styled-Component
Tailwind-Styled-Component copied to clipboard
Components remove duplicate values, break gradient
Looks like components created with this lib remove "duplicate" attributes and it particularly breaks gradient background where we have several from-, via- values.
const Background = tw.div`
bg-gradient-to-r from-indigo-500 from-10% via-purple-500 via-20$ to-pink-500 to-90%
`
<Background />
# Result
<div class="bg-gradient-to-r from-10% via-20$ to-90%"></div>
comparing to simple components
export const Background = () => (
<div className="bg-gradient-to-r from-indigo-500 from-10% via-purple-500 via-20$ to-pink-500 to-90%" />
)
# Result
<div class="bg-gradient-to-r from-indigo-500 from-10% via-purple-500 via-20$ to-pink-500 to-90%"></div>
this might be an issue with tailwind-merge which is what this lib uses to remove duplicated classes 🤔