Style
/ API Reference / Plugins
Style
/ API Reference / Plugins

fallbackValue

This plugin adds fallbacks to the style object.

The Gist

import { fallbackValuePlugin } from '@weser/style'

const plugin = fallbackValuePlugin([
  {
    property: ['width', 'height'],
    fallback: (value) => {
      if (value === 'min-content') {
        return ['-webkit-min-content', 'min-content']
      }
    },
  },
])

Parameters

ParameterTypeDefaultDescription
fallbacksArray<T_Fallback>[]An array of fallbacks to apply to the style.

Returns

(Plugin) A plugin function that can be passed to the createRenderer function.

On this page