Add a class to the body tag

How do I allow users to change a class applied to the body element of a page?

It is sometimes useful to have functionality where editors can change a class on the body element. This can facilitate choosing the colour scheme for a page, or allowing you to set a background image based on that selection. You can do this using Page Attributes.

To add a class to the body element I create a new template in perch/pages/templates/attributes and name it body_attributes.html this template includes a select list of classes.