Skip to content

feat: add attrs prop composition API #59

Open

Description

@waynevanson

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions