Code generation for theme builder.

Hierarchy (view full)

Properties

cssGenerator: CSSGenerator

The CSS code generator

key: string

The unique key for the node. It is unique from all other nodes in the ThemeBuilder

name: string

The name of the node, which is unique relative to it's siblings

Methods

  • Get a group of CSS variables associated with a particular node (i.e. atom, molecule, or organism).

    Parameters

    • node: INode

      The node for which we are getting the group of variables.

    Returns CSSVarGroup

    The variable group

  • Get all keys of all CSS variable groups.

    Returns string[]

    All keys associated with all CSS variable groups.

  • Get all CSS variables for this design system.

    Returns {
        [name: string]: string;
    }

    All CSS variables for this design system.

    • [name: string]: string
  • Get the JSON code generated by the theme builder for the default theme for light or dark mode.

    Parameters

    • lm: boolean

    Returns Object

    The JSON object.

  • Get the base JSON code generated by the theme builder for the default theme.

    Returns Object

    The JSON object.

  • Get the darkmode JSON code generated by the theme builder for the default theme.

    Returns Object

    The JSON object.

  • Get the lightmode JSON code generated by the theme builder for the default theme.

    Returns Object

    The JSON object.

  • Determine if this node is enabled. A node is enabled if all other nodes on which this node depends have been initialized.

    Returns boolean

    True if enabled, or false otherwise.

  • Determine if this node is initialized.

    If this node is a property, it is initialized if it is not required to have a value, or if it is required and has either a default or non-default value.

    Returns boolean

    True if initialized, or false otherwise.

  • Set a CSS variable listener which is called each time a CSS variable value is changed.

    Parameters

    • name: string

      The listener name.

    • Optionallistener: VarListener

      The listener callback.

    Returns void

  • Set a listener on this node

    Parameters

    • name: string

      The name of the listener.

    • callback: EventCallback

      The callback to call when an event occurs.

    • OptionaleventTypes: EventType[]

      The types of events to wait for. If none are specified, listen for all events.

    Returns ListenerSubscription

    The ListenerSubscription which should be canceled to stop listening.