How to save the output of php variables used in inline css code to the main style.css?
Question
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
:
<?php
<style type="text/css">
body {
color: <?php echo $text_color; ?>;
}
</style>
?>
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.
0
css, php
4 years
2020-02-09T08:38:33-05:00
2020-02-09T08:38:33-05:00 0 Answers
84 views
0
Leave an answer