Skip to content

Automated linting of Cascading Stylesheets with additonal rules for Wordpress theme styles

License

Notifications You must be signed in to change notification settings

rossleonardy/csslint-wptheme

 
 

Repository files navigation

CSSLint-WPTheme

CSSLint-WPTheme is an adaption of the open source CSS code quality tool originally written by Nicholas C. Zakas and Nicole Sullivan, CSSLint, to be used with wordpress theme stylesheets. Look here for more information on CSSLint.

Wordpress Selectors

CSSLint-WPTheme uses the list of selectors compiled by Jeff Star here and tests your theme's style.css for missing selectors needed by content generated by wordpress. CSSLint-WPTheme checks if you have written a valid css rule for each required selector, and warns you about each selector you don't have covered. It does not test the properties within the rules, so empty rules satisfy it–don't do this! It will be much more difficult for you to know what holes you have in your theme if your file is littered with empty CSS rules. Instead follow the instructions here to silence rules you don't plan on following.

Pitfalls

  1. CSSLint-WPTheme should work with Wordpress 4.7 and up, but it doesn't check for a version, and the list of selectors it checks may either include or exclude selectors necessary for the version your theme is targeting.
  2. The number of warnings is very high; you certainly do not need to implement all of these styles to have a working theme.

Contributors

  1. CSSLint Contributors (https://github.com/CSSLint/csslint)
  2. Ross Leonardy (WPTheme)

About

Automated linting of Cascading Stylesheets with additonal rules for Wordpress theme styles

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.4%
  • HTML 0.6%