@endeavorance/palette
    Preparing search index...

    Class Styles

    Helper API for managing CSS styles and CSSStyleSheets

    Constructors

    • Parameters

      • Optionalinit: HTMLElement | PropertiesHyphen<0 | string & {}, string & {}>

      Returns Styles

    Properties

    globalStylesheets: GlobalSheets = ...

    A set of stylesheets to always include in the result of css

    Methods

    • Apply these styles to an element

      Parameters

      • target: HTMLElement

      Returns void

    • Remove a style rule from this instance

      Parameters

      • propName: keyof PropertiesHyphen<0 | string & {}, string & {}>

      Returns void

    • Get the value of a single style

      Type Parameters

      • Prop extends keyof PropertiesHyphen<0 | string & {}, string & {}>

      Parameters

      Returns PropValue<Prop> | null

    • Check if this instance has a given style rule

      Parameters

      • propName: keyof PropertiesHyphen<0 | string & {}, string & {}>

      Returns boolean

    • Set a single style or custom property

      Type Parameters

      • Prop extends keyof PropertiesHyphen<0 | string & {}, string & {}>

      Parameters

      Returns void

    • Apply the styles in a Styles instance to an element

      Parameters

      • target: HTMLElement
      • styles: Styles | PropertiesHyphen<0 | string & {}, string & {}>

      Returns void

    • Parameters

      • strings: TemplateStringsArray
      • ...values: any[]

      Returns CSSStyleSheet[]

      An array of CSSStyleSheets containing the provided CSS

    • Create a Styles instance from a source object or element

      Parameters

      • target: HTMLElement | PropertiesHyphen<0 | string & {}, string & {}>

      Returns Styles