How to save the output of php variables used in inline css code to the main style.css?


I have some PHP variables that each represent some user settings set via a theme options interface such as:

  • theme colors
  • typography
  • etc.

All these variables are in a file called dynamic-style.php:

<style type="text/css">
body {
    color: <?php echo $text_color; ?>;

Is there a way to get the parsed CSS code from dynamic-style.php and save it to the main style.css at the bottom of the file? I need this to be done to decrease the number of HTTP requests on a public theme.

Thank you.

, Knott 4 years 2020-02-09T08:38:33-05:00 0 Answers 84 views 0

Leave an answer