# stylelint-config-property-sort-order-smacss

> Stylelint config for Property Sort Ordering based on the SMACSS methodology

Latest version **11.2.0** (published 2026-03-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install stylelint-config-property-sort-order-smacss
pnpm add stylelint-config-property-sort-order-smacss
yarn add stylelint-config-property-sort-order-smacss
bun add stylelint-config-property-sort-order-smacss
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 11.2.0 |
| Published | 2026-03-18 |
| First published | 2017-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.19.0 |
| Dependencies | 2 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Carl Hamilton |
| Maintainers | cahamilton |
| Keywords | CSS, SMACSS, Scalable and Modular Architecture for CSS, CSS Property Sort Order, stylelint, stylelint-config, stylelint-config-property-sort-order-smacss |

## Links

- npm: https://www.npmjs.com/package/stylelint-config-property-sort-order-smacss
- Repository: https://github.com/cahamilton/stylelint-config-property-sort-order-smacss
- Homepage: https://github.com/cahamilton/stylelint-config-property-sort-order-smacss#readme
- Issues: https://github.com/cahamilton/stylelint-config-property-sort-order-smacss/issues
- npm.io page: https://npm.io/package/stylelint-config-property-sort-order-smacss

## Dependencies (2)

- [stylelint-order](https://npm.io/package/stylelint-order.md) ^8.1.1
- [css-property-sort-order-smacss](https://npm.io/package/css-property-sort-order-smacss.md) 3.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 11.2.0 (latest) — 2026-03-18
- 11.1.0 — 2026-01-26
- 11.0.0 — 2026-01-25
- 10.0.0 — 2023-12-15
- 9.1.0 — 2023-02-21
- 9.0.0 — 2022-02-18
- 8.0.0 — 2021-10-30
- 7.1.0 — 2021-04-20
- 7.0.0 — 2020-10-31
- 6.4.0 — 2020-10-31
- 6.3.0 — 2020-05-15
- 6.2.1 — 2020-05-09
- 6.2.0 — 2020-05-08
- 6.1.0 — 2020-05-07
- 6.0.0 — 2020-02-06
- … 17 more at https://npm.io/package/stylelint-config-property-sort-order-smacss/versions

## README

<!-- omit from toc -->
# stylelint-config-property-sort-order-smacss

[![SMACSS Logo](https://user-images.githubusercontent.com/4007311/81406794-25fdbe00-9132-11ea-8e5d-dba7d3f3915e.png)](http://smacss.com)
[![Stylelint Logo](https://user-images.githubusercontent.com/4007311/81406797-272eeb00-9132-11ea-8b7d-cf84bece72a6.png)](https://github.com/stylelint/stylelint)

[![Build](https://github.com/cahamilton/stylelint-config-property-sort-order-smacss/actions/workflows/build.yml/badge.svg)](https://github.com/cahamilton/stylelint-config-property-sort-order-smacss/actions/workflows/build.yml)
[![CodeQL](https://github.com/cahamilton/stylelint-config-property-sort-order-smacss/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/cahamilton/stylelint-config-property-sort-order-smacss/actions/workflows/codeql-analysis.yml)
[![NPM version](https://img.shields.io/npm/v/stylelint-config-property-sort-order-smacss.svg)](https://www.npmjs.org/package/stylelint-config-property-sort-order-smacss)
[![NPM Downloads](https://img.shields.io/npm/dm/stylelint-config-property-sort-order-smacss.svg)](https://www.npmjs.org/package/stylelint-config-property-sort-order-smacss)

[Stylelint](https://github.com/stylelint/stylelint) config for Property Sort Ordering based on the [SMACSS](http://smacss.com) methodology.

<!-- omit from toc -->
## Table of Contents

- [Installation](#installation)
- [Basic Configuration](#basic-configuration)
- [Advanced Configuration](#advanced-configuration)
  - [Options](#options)
  - [Examples](#examples)
    - [Flexible Ordering](#flexible-ordering)
    - [Empty Line After Property Group](#empty-line-after-property-group)

## Installation

```bash
npm install stylelint-config-property-sort-order-smacss --save-dev
```

## Basic Configuration

To start using this configuration, simply extend this package in your Stylelint configuration.

```js
// stylelint.config.js

/**
 * @type {import('stylelint').Config}
 */
export default {
  extends: ['stylelint-config-property-sort-order-smacss'],
  rules: {
    // Add additional rules here
  },
};
```

Given the above, the following patterns are considered violations:

```css
a {
  color: red;
  top: 0;
}
```

```css
a {
  top: 0;
  color: black;
  position: absolute;
  display: block;
}
```

The following patterns are _not_ considered violations:

```css
a {
  top: 0;
  color: red;
}
```

```css
a {
  display: block;
  position: absolute;
  top: 0;
  color: black;
}
```

Refer to [css-property-sort-order-smacss](https://github.com/cahamilton/css-property-sort-order-smacss/blob/v3.0.0/src/index.ts) for the comprehensive list of property orders.

For more information on configuring Stylelint, check out the [configuration](https://github.com/stylelint/stylelint/blob/17.0.0/docs/user-guide/configure.md) guide.

## Advanced Configuration

<!-- eslint-disable-next-line markdown/no-missing-label-refs -->
> [!NOTE]
> This requires a JavaScript configuration file (eg. `stylelint.config.js`, `stylelint.config.mjs`) and is not supported by JSON, YAML or other file formats.

The basic configuration outlined above, will enforce that properties are **strictly** sorted within their groups (box, border, background etc). Given this configuration makes use of [stylelint-order](https://github.com/hudochenkov/stylelint-order/tree/8.1.1), there's a couple extra bits of functionality that can be configured. This will require manually generating the configuration - but passing in extra options as required. These will be applied to **each** property group.

### Options

```ts
type Options = {
  emptyLineBefore?: 'always' | 'never' | 'threshold';
  noEmptyLineBetween?: boolean;
  order?: 'flexible';
  unspecified?: 'top' | 'bottom' | 'bottomAlphabetical' | 'ignore';
  emptyLineBeforeUnspecified?: 'always' | 'never' | 'threshold';
  emptyLineMinimumPropertyThreshold?: number;
};
```

Refer to the [properties-order](https://github.com/hudochenkov/stylelint-order/blob/8.1.1/rules/properties-order/README.md#options) documentation for more information on available options.

All options except `properties` and `groupName` can be modified.

### Examples

#### Flexible Ordering

This will allow properties within the same group to be in any order.

Given:

```js
// stylelint.config.js

import generateConfig from 'stylelint-config-property-sort-order-smacss/generate';

export default {
  plugins: ['stylelint-order'],
  rules: {
    'order/properties-order': generateConfig(),
  },
};
```

The following patterns are considered violations:

```css
a {
  top: 0;
  position: absolute;
  display: block;
  color: black;
}
```

Given:

```js
// stylelint.config.js

import generateConfig from 'stylelint-config-property-sort-order-smacss/generate';

export default {
  plugins: ['stylelint-order'],
  rules: {
    'order/properties-order': generateConfig({
      order: 'flexible',
    }),
  },
};
```

The following patterns are _not_ considered violations:

```css
a {
  top: 0;
  position: absolute;
  display: block;
  color: black;
}
```

#### Empty Line After Property Group

This will allow an empty line after each property group:

Given:

```js
// stylelint.config.js

import generateConfig from 'stylelint-config-property-sort-order-smacss/generate';

export default {
  plugins: ['stylelint-order'],
  rules: {
    'order/properties-order': generateConfig({
      emptyLineBefore: 'never',
    }),
  },
};
```

The following patterns are considered violations:

```css
a {
  display: block;
  position: absolute;
  top: 0;

  color: black;
}
```

Given:

```js
// stylelint.config.js

import generateConfig from 'stylelint-config-property-sort-order-smacss/generate';

export default {
  plugins: ['stylelint-order'],
  rules: {
    'order/properties-order': generateConfig({
      emptyLineBefore: 'always',
    }),
  },
};
```

The following patterns are _not_ considered violations:

```css
a {
  display: block;
  position: absolute;
  top: 0;

  color: black;
}
```

---
_Source: https://npm.io/package/stylelint-config-property-sort-order-smacss · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
