Skip to content
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

feat: add attrs prop composition API #59

Open
waynevanson opened this issue Jan 20, 2025 · 0 comments
Open

feat: add attrs prop composition API #59

waynevanson opened this issue Jan 20, 2025 · 0 comments

Comments

@waynevanson
Copy link

Have you considered adding styled components composition attrs API?

Example for this library.

import styled from "solid-styled-components"

const First = styled("div").attrs((props: { size: number }) => ({
  weight: Math.max(100, Math.min(1000, size))
})`
  font-weight: ${props => props.weight};
`

const First = styled("div").attrs({
    weight: 500
})`
  font-weight: ${props => props.weight};
`

It's great for adding default or derived props that apply to element attributes.

I may be able to provide the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant