Traditionally, styles have been "plopped" onto web applications without any forethought. Usually, we would just style our pages without any thought to modularity, reusability, and maintainability. However, this is no longer acceptable due to the extensive nature of web applications today.
In this book, we have strived to adhere to a couple of industry standards, such as modularity. However, we do have tools now that can help us validate and profile our styles. Starting with an analysis of a sample CSS file, we can then optimize those styles; this is what we aim to do in this section of the chapter.
In order to optimize our stylesheets, we need to first verify that our CSS is valid and compliant with today's standards. We can use various tools out there to validate our styles, including the W3C CSS Validator and a tool called CSS Lint. Both these tools check your stylesheets and give you a summary of what is wrong, why it is wrong, and what you should...