Skip to content

twind/style should support a css property that allows to use other props to create custom css #219

@sastan

Description

@sastan
import { styled } from "@twind/react"

interface IAutoGridProps {
  amount: number;
  minWidth: number;
  maxWidth: number;
}

const AutoGrid = styled('div', {
  // New property that accepts a function which is passed all props
  css: ({ amount, minWidth, maxWidth }: IAutoGridProps) => ({
    gridTemplateColumns: `repeat(${amount}, minmax(${minWidth}, ${maxWidth}))`
  })
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ Feature RequestSomething should be added🙅 HoldProgress on the issue is stopped

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions