Back to directory
peter-neumann-dev avatar
peter-neumann-dev / css-order

css-order

๐ŸŽจ Custom order for consistent sorting of CSS properties

7

Stars

0

Forks

3

Watchers

GPL-3.0

License

๐ŸŽจ CSS Properties-Order

An order for consistent sorting of CSS properties

Release License


๐Ÿš€ What it does

Can be used within IDEs or code editors to sort CSS properties in a consistent order on code reformat command.

โš™๏ธ Setup

JetBrains IDEs

  1. Open the code style settings for CSS, SCSS or SASS (according to your needs)
    • File | Settings | Editor | Code Style | Style Sheets | SCSS for Windows and Linux
    • Your IDE | Settings | Editor | Code Style | Style Sheets | SCSS for macOS
  2. Open the tab "Arrangement"
  3. Select "Custom order"
  4. Add the CSS properties from css-order.txt

Read more about Code Style Arrangement in the JetBrains documentation.

VS Code

  1. Install the PostCSS Sorting extension
  2. Add the CSS properties from css-order.txt to the extension settings
  3. Override the Keybinding to perform the sorting on save
[
  {
    "key": "cmd+s",
    "command": "runCommands",
    "when": "resourceExtname  =~ /^.(scss|sass|css)$/",
    "args": {
      "commands": [
        "postcssSorting.execute",
        "workbench.action.files.save"
      ]
    }
  }
]

Thanks to Sebastian Richter for providing these instructions.

๐Ÿ’Ž Credits

Inspired by Concentric CSS from Brandon Rhodes.

Releases

Apr 2, 2024

v1.2.0 | Extended docs

Download .zip

๐Ÿ”ง Tasks

Add documentation for JetBrains IDEs and VS Code

Full Changelog: v1.1.0...v1.2.0

Nov 20, 2023

v1.1.0 | New logical properties and add aspect-ratio

Download .zip

โœจ Features

Add aspect-ratio property Add additional logical properties for inset, overflow and dimensions

Full Changelog: v1.0.0...v1.1.0

Jun 3, 2023

v1.0.0 | Initial release with default order

Download .zip

โœจ Features

Initial release with default order

Full Changelog: v1.0.0