Socket
Socket
Sign inDemoInstall

prettier-plugin-css-order

Package Overview
Dependencies
8
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    prettier-plugin-css-order

Sort CSS declarations in a certain order.


Version published
Weekly downloads
16K
decreased by-14.53%
Maintainers
1
Install size
140 kB
Created
Weekly downloads
 

Changelog

Source

[2.1.2] - 2024-04-01

Fixed

  • Bring back custom order feature introduced in 2.1.0.

Readme

Source

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!

Keywords

FAQs

Last updated on 01 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc