Part 2: In-Depth Guide On WordPress Coding Standards For CSS & JS

Page 1

Part 2: In-Depth Guide On WordPress Coding Standards For CSS & JS:Hello.! All and Welcome to another edition our blog series on WordPress Coding Standards. In the previous edition of our series i.e. Part 1, we had discussed the WordPress Coding Standards for PHP & HTML. Today, we’re going to discuss the Part 2 of our series which is based on the WordPress Coding Standards for CSS & JS. So, let’s not waste any time & straightway get into the action.

WordPress Coding Standards For CSS 1. Structure If you’re utilizing working in a Web Design Company for a long time, then you must be knowing that there are many methods for structuring the CSS. Now, one thing is very clear that when you’re using CSS, you need to retain a high degree of readability. Here are some things that you need to keep in mind while using CSS for WordPress: ● ● ● ●

Use tabs and not spaces for proper indentation. Add 2 blank line between section & 1 blank line between the block in section. Each selector should be on one line, either ending with a comma or a closing braces (}). For a property-value pair, maintain it on one line with one tab indentation & always end it with a semicolon. ● The closing braces (}) should be left aligned & follow the same indentation as opening braces ({). Example: -> Incorrect #selector-1, #selector-2 { background: #fff; color: #111; }


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.