ixfx
    Preparing search index...

    Function toStringFirst

    • Returns a CSS-ready string representation.

      element.style.backgroundColor = resolveToString(`red`);
      

      Tries each parameter in turn, returning the value for the first that resolves. This can be useful for having fallback values.

      // Try a CSS variable, a object property or finally fallback to red.
      element.style.backgroundColor = toStringFirst('--some-var', opts.background, `red`);

      Parameters

      • ...colours: (undefined | Colourish)[]

        Array of colours to resolve

      Returns string