1. React
  2. CSS-Minsk-JS
  3. 2018
  4. Unused CSS code: identification and clean up

Unused CSS code: identification and clean up

Anton Kholkin at CSS-Minsk-JS 2018

Removing of unused CSS code — one of the Frontend optimization problems at the Booking.com website. In total for all user cases and variations — there are around 50K CSS selectors. It’s impossible to detect unused selectors just by doing a static analysis in the code base. As impossible to do manual testing due to the big number of scenarios/variations (around 2K). We’ve built a code coverage of CSS code, using a crowdsourcing approach. I will cover, why we went that way and how going that way we minimized the negative impact (and even avoided in some cases) on user experience. I’ll cover, how based on the code coverage, we validated it using an A/B testing before the eventual code removal from the code base.