Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fresh/plugins/twindv1_deps.ts>Style

The next-gen web framework.
Extremely Popular
Go to Latest
interface Style
import { type Style } from "https://deno.land/x/fresh@1.5.4/plugins/twindv1_deps.ts";

Call Signatures

(props?: StyleProps<Variants>): string

CSS Class associated with the current component.

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

<div className={button()} />
(match: MatchResult): string

To be used as resolve within config.rules:

{
  rules: [
    // label?prop=value&other=propValue
    // if the style has base eg no prop is required
    ['label(\\?.+)?', style( /* ... *\/ )],

    // if the style requires at least one prop
    ['label\\?(.+)', style( /* ... *\/ )],
  ]
}

The first group is used to extract the props using !URLSearchParams | URLSearchParams.

Properties

readonly
defaults: StyleProps<Variants>
readonly
className: string

CSS Class associated with the current component.

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

<div className={button.className} />
readonly
selector: string

CSS Selector associated with the current component.

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

const Card = styled({
  base: css`
    & ${button.selector} {
      boxShadow: "0 0 0 5px"
    }
  `
})