Hi everyone,
I'm currently working on an Umbraco 12 project. My client wants the ability to manage a significant portion of the website's CSS directly from the Backoffice. They envision this functioning akin to Site Builders like Igloo Theme and uSkinned. However, they've emphasized that they want a custom solution without incorporating any packages. The CSS settings they want to configure from the backoffice include theme colors, spacing, fonts, dimensions, and more.
Up to now, I've created custom property editors to store these values in the backoffice. However, I'm struggling to understand how Site Builders achieve dynamic CSS updates. From what I've gathered, there's a template CSS file containing CSS properties/variables. These variables in the template CSS file have default or placeholder values. When the user updates the "Theme" node (where all theme/CSS settings are configured), a copy of the CSS template file is generated with the updated values provided by the user in the "Theme" node. Subsequently, the master template links the generated CSS file.
I have a (rather large) question: How would you approach dynamically changing the CSS variables? How would you go about programmatically generating a new CSS file and ensuring that the values stored in my custom property editors are correctly integrated into the newly generated CSS file?