prettier-plugin-css-order

2.1.2 • Public • Published

CSS Order Prettier Plugin

npm

A Prettier plugin to sort CSS, SCSS or Less declarations based on their property names.
Using css-declaration-sorter under the hood.

Usage

Following the Prettier plugin guidelines, this package depends on Prettier as a peer dependency:
npm install postcss prettier-plugin-css-order --save-dev

To enable the plugin use the Prettier API, CLI or configuration file. For example using the JS configuration:

{
  plugins: ["prettier-plugin-css-order"]
}

Configuration

This plugin adds two configurable keys to Prettier:

  • cssDeclarationSorterOrder defaults to concentric-css.
  • cssDeclarationSorterKeepOverrides defaults to true, for a new codebase false is recommended.
  • cssDeclarationSorterCustomOrder, an array of property names, their order is used to sort with. This overrides the cssDeclarationSorterOrder option!

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.1.2
40,870latest

Version History

VersionDownloads (Last 7 Days)Published
2.1.2
40,870
2.1.1
142
2.1.0
0
2.0.1
3,272
2.0.0
159
1.3.11,292
1.3.03,229
1.2.013
1.1.00
1.0.00

Package Sidebar

Install

npm i prettier-plugin-css-order

Weekly Downloads

48,977

Version

2.1.2

License

ISC

Unpacked Size

5.58 kB

Total Files

4

Last publish

Collaborators

  • siilwyn