Style
/ API Reference / PluginsStyle
/ API Reference / PluginssortProperty
This plugin sorts properties according to a property priority map.
The Gist
import { sortPropertyPlugin } from '@weser/style'
// this ensures longhand margin properties always take precedence
// over the shorthand 'margin' property
const plugin = sortPropertyPlugin({
marginLeft: 2,
marginRight: 2,
marginTop: 2,
marginBottom: 2,
})
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| propertyPriority | Record<keyof T_Style, number> | The property priority map. The higher the number, the higher the priority. |
Returns
(Plugin) A plugin function that can be passed to the createRenderer function.
© 2024-present Robin Weser. All Rights Reserved.