Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StyleProvider<T, R>

Construct your own style provider with a custom fallback style object

Type parameters

  • T: __type

  • R

Hierarchy

  • StyleProvider

Index

Constructors

constructor

Properties

Private converter

converter: function

Type declaration

    • (css: string): R
    • Parameters

      • css: string

      Returns R

Private fallback

fallback: T

Private mount

mount: string

Private renderAll

renderAll: boolean

Private rendered

rendered: Map<DeepPartial<T>, R> = new Map()

Private renderedAll

renderedAll: Map<DeepPartial<T>, R> = new Map()

Private Optional renderedFallback

renderedFallback: RenderResult

Methods

Private dashCase

  • dashCase(s: string): string
  • Convert PascalCase / camelCase to dash-case

    Parameters

    • s: string

    Returns string

Private fields

  • fields(fallback: string[], custom: string[]): string
  • Convert two arrays of fields to a final field resolver CSS string

    Parameters

    • fallback: string[]
    • custom: string[]

    Returns string

Private generate

  • generate(styles: DeepPartial<T>, renderAll: boolean): R

Private parser

  • Return an array of CSS vars and a list of created vars from a styles object

    Type parameters

    • S: __type

    Parameters

    Returns ParserResult

Private render

rootStyleProvider

  • Generate the root CSS string from a styles object if no cached version is found

    Parameters

    Returns R

styleProvider

  • styleProvider(styles?: DeepPartial<T>, renderAll?: boolean): R
  • Generate a CSS string from a styles object if no cached version is found

    Parameters

    • Default value styles: DeepPartial<T> = emptyStyles
    • Default value renderAll: boolean = this.renderAll

    Returns R

Generated using TypeDoc