Skip to content

Instantly share code, notes, and snippets.

@GaryJones
Last active November 2, 2018 19:49
Show Gist options
  • Save GaryJones/33139136fedc578ebd79 to your computer and use it in GitHub Desktop.
Save GaryJones/33139136fedc578ebd79 to your computer and use it in GitHub Desktop.
[Replaced] CSSComb file for WP core.
See https://github.com/cedaro/grunt-wp-css/blob/develop/tasks/config/default.json
@GaryJones
Copy link
Author

Configuration Options are detailed at https://github.com/csscomb/csscomb.js/blob/master/doc/options.md

Current WP CSS coding standards for property ordering are outlined at http://make.wordpress.org/core/handbook/coding-standards/css/#property-ordering . These are too generic, so using an automated tool (via grunt, editor plugin, website (once re-done)) with unambiguous prescriptive list of individual properties is better.

exclude and verbose are optional and just here to show they exist. Main focus here is the sort order. Properties are broken up into Display, Positioning, Box Model, Colors and Typography, and Other as per CS. All given in one array, so no clear linespaces will appear in the sorted output. $variable and $include cover sorting with both Sass and LESS variables and mixins / extend, so suitable for all projects outside of core too.

https://core.trac.wordpress.org/ticket/20570#comment:32
https://core.trac.wordpress.org/ticket/22097

Feedback welcome.

@saas786
Copy link

saas786 commented Jan 19, 2015

Thanks @GaryJones

Using it with my upcoming projects. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment