Came across an interesting video about debugging rendering performance in Chrome devtools. In his lesson Umar identifies the changing of a CSS class on the html tag as the source of a rendering bottleneck. Devtools shows that changing this class potentially affects the 3,874 elements in the DOM below html and triggers an expensive recalculate style operation.
In the past I've added CSS classes to my html or body tag as a convenient way to express the state of the page at that level.
Your CMS may do it for the same purpose. For example, in a WordPress site you may see a bunch of classes like post-template-default single single-post postid-99999 single-format-standard logged-in category-news subcategory-uk has-hover on a post's body tag.
Should we avoid this practice? Or will it only affect rendering performance when the classes are used in CSS rules?