# @types/css-declaration-sorter

> TypeScript definitions for css-declaration-sorter

Latest version **6.0.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/css-declaration-sorter
pnpm add @types/css-declaration-sorter
yarn add @types/css-declaration-sorter
bun add @types/css-declaration-sorter
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.0.4 |
| Published | 2023-11-07 |
| First published | 2020-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51469 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/css-declaration-sorter
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/css-declaration-sorter
- npm.io page: https://npm.io/package/@types/css-declaration-sorter

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^8.0.9

## Recent versions

- 6.0.4 (latest) — 2023-11-07
- 6.0.2 (ts4.3) — 2023-09-04
- 6.0.1 (ts3.7) — 2021-07-06
- 5.1.0 (ts3.0) — 2020-06-21
- 6.0.3 — 2023-10-18
- 6.0.0 — 2021-06-17

## README

# Installation
> `npm install --save @types/css-declaration-sorter`

# Summary
This package contains type definitions for css-declaration-sorter (https://github.com/Siilwyn/css-declaration-sorter#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/css-declaration-sorter.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/css-declaration-sorter/index.d.ts)
````ts
import { PluginCreator } from "postcss";

/**
 * A Node.js module and PostCSS plugin to sort CSS, SCSS or Less declarations based on their property names.
 */
declare namespace cssDeclarationSorter {
    /**
     * Default, order in a simple alphabetical manner from a - z.
     */
    type Alphabetical = "alphabetical";

    /**
     * Order from most important, flow affecting properties, to least important properties.
     * ```
     * 1. Box
     * 2. Border
     * 3. Background
     * 4. Text
     * 5. Other
     * ```
     */
    type SMACSS = "smacss";

    /**
     * Order properties applying outside the box model, moving inward to intrinsic changes.
     * ```
     * 1. Positioning
     * 2. Visibility
     * 3. Box model
     * 4. Dimensions
     * 5. Text
     * ```
     */
    type ConcentricCSS = "concentric-css";

    type SortOrder = Alphabetical | SMACSS | ConcentricCSS;

    /**
     * This function receives two declaration names and is expected
     * to return -1, 0 or 1 depending on the wanted order.
     */
    type SortFunction = (aProp: string, bProp: string) => -1 | 0 | 1;

    interface Options {
        /**
         * Provide the name of one of the built-in sort orders or a comparison function that is passed to `Array.sort`.
         * @default 'alphabetical'
         */
        order?: SortOrder | SortFunction | undefined;
        /**
         * To prevent breaking legacy CSS where shorthand declarations override longhand declarations
         * (also taking into account vendor prefixes) this option can enabled.
         * For example `animation-name: some; animation: greeting;` will be kept in this order when `keepOverrides` is `true`.
         */
        keepOverrides?: boolean | undefined;
    }

    type CssDeclarationSorter = PluginCreator<Options>;
}

declare const cssDeclarationSorter: cssDeclarationSorter.CssDeclarationSorter;
export = cssDeclarationSorter;

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:05 GMT
 * Dependencies: [postcss](https://npmjs.com/package/postcss)

# Credits
These definitions were written by [Piotr Błażejewicz](https://github.com/peterblazejewicz).

---
_Source: https://npm.io/package/@types/css-declaration-sorter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
