If you’re wanting styles to be dynamic, then you’ll have to emit your CSS file as you are suggesting. However, as WordPress often uses styles.css as a theme definition file, renaming styles.php might cause problems.
It might be better to collect all the ‘dynamic’ definitions into a separate file (eg dynamic-styles.php) and import them from your main style.css file via @import(url)
,
3
solved How do you modify CSS files via admin panel?