Old Fashioned CSS Sorter
A Visual Studio Code extension that helps you keep your CSS properties organized and consistent using intelligent sorting strategies.
Features
Usage
- Open a CSS, SCSS, or SASS file
- Run the command "Sort CSS Properties (Old Fashioned)" from the command palette (Ctrl+Shift+P or Cmd+Shift+P)
- Your properties will be sorted according to your chosen strategy
Demo

🎯 Feature Comparison Table
🧩 Feature / Tool Capability |
CSSComb |
Stylelint (w/ plugins) |
Prettier |
Old-Fashioned CSS |
📅 Multiple sorting methodologies |
✅ (via presets) |
⚠️ (manual setup only) |
❌ |
✅ Alphabetical, Concentric |
🧱 Idiomatic sorting (SMACSS, BEM, etc.) |
✅ |
⚠️ (plugin-dependent) |
❌ |
✅ Built-in presets |
🧠 Property grouping & spacing |
✅ |
⚠️ (needs config) |
❌ |
✅ Automatic |
💡 Intelligent formatting (before sorting) |
❌ |
⚠️ (not default) |
✅ Formatting only |
✅ Context aware |
🧱 SCSS support (nesting, variables) |
✅ |
✅ (via stylelint-scss ) |
⚠️ Partial |
✅ Full |
🧬 Handles @rules like @property , @media |
⚠️ Limited |
⚠️ Some support |
⚠️ Basic |
✅ Extensive |
⚙️ Fine-grained configurability |
✅ via .csscomb.json |
✅ with multiple plugins |
❌ (non-configurable) |
✅ Built-in + Workspace local |
🛠️ Integration with editors & workflows |
⚠️ Outdated |
✅ Modern integrations |
✅ Excellent |
✅ Designed for VS Code |
🛰️ Community preset sharing |
✅ |
⚠️ Limited |
❌ |
🟡 Planned |
👷 Maintained / actively developed |
❌ Abandoned |
✅ Active |
✅ Active |
✅ Active |
🧭 Learning-friendly (teaches logical order) |
⚠️ Implicit |
⚠️ Depends on rules |
❌ |
✅ Explicit via strategy |
Extension Settings
This extension contributes the following settings:
oldFashioned.sorting.strategy
: Choose the sorting strategy (alphabetical, concentric, idiomatic)
oldFashioned.sorting.emptyLinesBetweenGroups
: Add empty lines between property groups
oldFashioned.sorting.sortPropertiesWithinGroups
: Sort properties alphabetically within each group
oldFashioned.showActivationMessage
: Show a message when the extension is activated
oldFashioned.showDebugComments
: Show debug comments in the sorted CSS output (default: false)
oldFashioned.notificationLevel
: Control how many notifications are shown (verbose, minimal, none)
oldFashioned.formatting.formatBeforeSorting
: Format the document before sorting (default: true)
Configuration
Sorting Configuration
- Sorting Strategy: Choose the sorting strategy (alphabetical, concentric, idiomatic)
- Empty Lines Between Groups: Add empty lines between property groups
- Sort Properties Within Groups: Sort properties alphabetically within each group
- Format Before Sorting: Enable or disable automatic formatting using VS Code's built-in formatter before sorting properties (default: true)
Sorting Strategies Explained
Alphabetical
Properties are sorted A-Z, making it easy to find a specific property. This is the simplest strategy and works well for teams without specific ordering preferences.
Example:
.element {
background-color: white;
color: black;
display: flex;
margin: 10px;
padding: 15px;
position: relative;
width: 100%;
z-index: 1;
}
Concentric
Based on Concentric CSS by Brandon Rhodes, this strategy sorts properties from outside-in:
- Position & z-index (how it's placed)
- Display & box model (how it's displayed)
- Dimensions (size)
- Margins (space outside)
- Borders (the boundary)
- Padding (space inside)
- Background & colors (appearance)
- Text & font properties (content styling)
- Other properties (everything else)
Example:
.element {
position: relative;
z-index: 1;
display: flex;
width: 100%;
margin: 10px;
padding: 15px;
background-color: white;
color: black;
}
Idiomatic
Based on Idiomatic CSS by Nicolas Gallagher, this strategy follows a logical progression of properties:
- Positioning
- Box model
- Borders
- Background
- Typography
- Visual effects
- Animation
- Other
Example:
.element {
position: relative;
z-index: 1;
display: flex;
width: 100%;
margin: 10px;
padding: 15px;
background-color: white;
color: black;
}
Stylelint Integration
This extension can optionally integrate with project-level stylelint configurations:
- If your project uses stylelint with either
stylelint-order
or stylelint-oldfashioned-order
plugin, the extension will detect and use those settings
- You can define your sorting preferences at the project level through stylelint rather than in VS Code settings
- If both are present, the VS Code settings take precedence
Troubleshooting
Common Issues
Q: My properties aren't being sorted correctly
A: Check your strategy selection in the settings (Ctrl+,). Different strategies will produce different orders.
Q: The extension doesn't activate
A: Make sure you're working with a .css, .scss, or .sass file. The extension only activates for these file types.
Q: I don't see empty lines between my property groups
A: Check that oldFashioned.sorting.emptyLinesBetweenGroups
is set to true
in your settings.
Getting Support
If you encounter issues not addressed here, please open an issue on our GitHub repository.
Keyboard Shortcuts
By default, Old Fashioned doesn't come with predefined keyboard shortcuts to avoid conflicts with other extensions. However, you can easily set up your own shortcuts:
- Open VS Code and go to File > Preferences > Keyboard Shortcuts (or press
Ctrl+K Ctrl+S
/ Cmd+K Cmd+S
on macOS)
- Click on the "Open Keyboard Shortcuts (JSON)" button in the top right corner of the editor
- Add your preferred shortcut to the
keybindings.json
file.
Here are some suggested keyboard shortcuts that shouldn't conflict with VS Code's default bindings:
// Option 1: Similar to Format Document (Shift+Alt+F with additional Ctrl key)
{
"key": "ctrl+shift+alt+f",
"command": "oldFashioned.sortProperties",
"when": "editorTextFocus && (editorLangId == 'css' || editorLangId == 'scss' || editorLangId == 'sass')"
}
// Option 2: Alternative using Ctrl+K prefix (common in VS Code)
{
"key": "ctrl+k s",
"command": "oldFashioned.sortProperties",
"when": "editorTextFocus && (editorLangId == 'css' || editorLangId == 'scss' || editorLangId == 'sass')"
}
// Option 3: For Mac users
{
"key": "cmd+k s",
"command": "oldFashioned.sortProperties",
"when": "editorTextFocus && (editorLangId == 'css' || editorLangId == 'scss' || editorLangId == 'sass')"
}
Choose the option that works best for your workflow. The first option adds an additional Ctrl key to the standard Format Document shortcut, while the second and third options use the Ctrl+K/Cmd+K chord system common in VS Code.
Available Commands
oldFashioned.sortProperties
: Sort properties using the configured strategy
oldFashioned.sortPropertiesAlphabetical
: Sort properties alphabetically
oldFashioned.sortPropertiesConcentric
: Sort properties using the concentric strategy
oldFashioned.sortPropertiesIdiomatic
: Sort properties using the idiomatic strategy
oldFashioned.sortPropertiesGrouped
: Sort properties using the grouped strategy
Release Notes
See CHANGELOG.md for detailed release notes.
This extension is published by N8D on the Visual Studio Code Marketplace.
For Developers Looking to Publish
If you're forking or contributing to this project, you'll need your own publisher ID to publish it:
- Create a publisher account at https://marketplace.visualstudio.com/manage
- Update the
publisher
field in package.json
with your publisher ID
- Follow the VS Code publishing instructions
Development
Building the Extension VSIX
To build the extension as a VSIX package for installation in VS Code:
# From the root of the workspace
nx run vscode-old-fashioned:build # First build using esbuild
nx run vscode-old-fashioned:package # Then package into VSIX
# Or navigate to the extension directory and use npm directly
cd packages/vscode-old-fashioned
npm run esbuild # Build using esbuild
npm run package # Package into VSIX
The resulting VSIX file will be available in the packages/vscode-old-fashioned
directory.
Installing the VSIX
Once you have built the VSIX file, you can install it in VS Code:
- Open VS Code
- Go to the Extensions view (
Ctrl+Shift+X
or Cmd+Shift+X
)
- Click on the
...
menu (top right of the Extensions view)
- Select "Install from VSIX..."
- Navigate to the VSIX file and select it
Alternatively, you can install it from the command line:
code --install-extension path/to/vscode-old-fashioned-0.0.1.vsix