How can I save a user-defined CSS theme similar to the WordPress editor?

I’m developing a diary application that lets users change its look—cover design, background, fonts, and colors—using a live CSS editor. How do I persist and reapply these style choices?