Function selectFirst

  • Selects the first style rule in the stylesheet whose cssText begins with any of the specified selectors.

    Parameters

    • selectors: string

      The starting text of the style rules to return

    • styleSheet: CSSStyleSheet

      The CSSStyleSheet containing the rules to select

    Returns CSSRule | undefined

    The selected style rule

    Example

    import { selectFirst } from 'deleight/css';
    const cssStyleSheet = await loadStyle('component1.css');
    const firstSpanRule = selectFirst('span', cssStyleSheet)