2.0.2 • Published 4 months ago

brandeur-plugin-sort-property v2.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

brandeur-plugin-sort-property

Sorts properties according to a property priority map.

Installation

# npm
npm i --save brandeur-plugin-sort-property
# yarn
yarn add brandeur-plugin-sort-property
# pnpm
pnpm add brandeur-plugin-sort-property

Usage

import sortProperty from 'brandeur-plugin-sort-property'

const plugin = sortProperty({
  paddingTop: 2,
  paddingRight: 2,
  paddingBottom: 2,
  paddingLeft: 2,
})

Configuration

Parameter Type Description
priorityMapPriorityMap  A map of CSS properties and their sorting priority. Default priority is 1

PriorityMap

Record<keyof CSSProperties, number>

Input

Using the example configuration from above.

{
  paddingLeft: 5,
  padding: 10,
}

Output

{
  padding: 10,
  paddingLeft: 5,
}

License

Brandeur is licensed under the MIT License. Documentation is licensed under Creative Commons License. Created with ♥ by @robinweser.

2.0.2

4 months ago

2.0.1

9 months ago

2.0.0

10 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

1 year ago