There’s a discussion of a very similar question here.
As in that question, there are a few suggested options, each with their own pros and cons.
For what you describe, it sounds like you might want to consider the idea of generating a CSS file every time the admin changes any settings on this page. This is the fastest option because you don’t need to re-do this work on every page load.
I’m not sure if there’s an easy way to do this (perhaps someone else will know a way), so if you like that approach it seems like you need to do these steps:
- Make sure that from PHP you can write to a .css file somewhere. Perhaps make a new plugin for this feature and put the code and generated CSS file in the plugin.
- Make sure that the .css file can be easily enqueue’d from WordPress
- Write a script which takes all of your options from
wp_options
and writes a complete CSS file - Hook that script so that it re-generates the CSS every time the admin page is saved.
HTH