brandeur-plugin-sort-property
Version:
Brandeur plugin that sorts properties according a priority map
68 lines (49 loc) • 1.71 kB
Markdown
Sorts properties according to a property priority map.
<img alt="npm version" src="https://badge.fury.io/js/brandeur-plugin-sort-property.svg"> <img alt="npm downloads" src="https://img.shields.io/npm/dm/brandeur-plugin-sort-property.svg"> <a href="https://bundlephobia.com/result?p=brandeur-plugin-sort-property@latest"><img alt="Bundlephobia" src="https://img.shields.io/bundlephobia/minzip/brandeur-plugin-sort-property.svg"></a>
```sh
npm i --save brandeur-plugin-sort-property
yarn add brandeur-plugin-sort-property
pnpm add brandeur-plugin-sort-property
```
```ts
import sortProperty from 'brandeur-plugin-sort-property'
const plugin = sortProperty({
paddingTop: 2,
paddingRight: 2,
paddingBottom: 2,
paddingLeft: 2,
})
```
| Parameter | Type | Description |
| ----------- | ----------------------------- | --------------------------------------------------------------------------- |
| priorityMap | [PriorityMap](
```ts
Record<keyof CSSProperties, number>
```
> Using the example configuration from above.
```ts
{
paddingLeft: 5,
padding: 10,
}
```
```ts
{
padding: 10,
paddingLeft: 5,
}
```
Brandeur is licensed under the [MIT License](http://opensource.org/licenses/MIT).<br>
Documentation is licensed under [Creative Commons License](http://creativecommons.org/licenses/by/4.0/).<br>
Created with ♥ by [@robinweser](https://weser.io).