Chapter 5. Testing

Testing CSS can be difficult because there are so many different platforms, screen sizes, and form factors that need to be tested. This chapter explores how to determine which browsers and devices need to be tested as well as a number of different ways to test and maintain your CSS. By the end of this chapter you should have a better idea of how to approach testing your CSS, which will result in a higher level of confidence when making changes.

Why Is Testing Difficult?

Thoroughly testing CSS changes can take a long time and requires a lot of different tools.

There are many factors to consider, including:

  • Which browser is the page being tested on?

  • How do you test various browsers on different operating systems?

  • What size is the window that the page is being viewed in?

  • How can a large number of pages be tested quickly?

  • How do you verify that what you’re seeing is correct?

  • How can a website be tested on other devices if you don’t have access to those specific devices?

Which Browsers Are Important to Test?

Before testing, it’s important to know which browsers should be tested. Ideally you will only need to support browsers that are being used to view your website by a minimum number of people (the particular threshold can vary from company to company). You can identify these fairly easily by using an analytics tool that breaks down all of the browsers and devices and the versions of each that are used by the website’s visitors.

Browser Market ...

Get CSS Refactoring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.