Interface: Style<Variants>

twind/style.Style

Type parameters

Name
Variants

Callable

Style(props?: StyleProps<Variants>): Directive<CSSRules>

CSS Class associated with the current component.

const button = style({
  base: {
    color: "DarkSlateGray"
  }
})

<div className={tw(button())} />

Parameters:

NameType
props?StyleProps<Variants>

Returns: Directive<CSSRules>

Defined in: src/style/index.ts:92

Properties

className

Readonly className: string

CSS Class associated with the current component.

const button = style({
  base: {
    color: "DarkSlateGray"
  }
})

<div className={button.className} />

Defined in: src/style/index.ts:141


selector

Readonly selector: string

CSS Selector associated with the current component.

const button = style({
  base: {
    color: "DarkSlateGray"
  }
})

const Card = styled({
  base: {
    [Button.selector]: { boxShadow: "0 0 0 5px" }
  }
})

Defined in: src/style/index.ts:160

Methods

toString

toString(): string

CSS Selector associated with the current component.

const button = style({
  base: {
    color: "DarkSlateGray"
  }
})

const article = style({
  base: {
    [button]: { boxShadow: "0 0 0 5px" }
  }
})

Returns: string

Defined in: src/style/index.ts:126