Support

Account

Home Forums Backend Issues (wp-admin) Suggestions for creating dynamic stylesheets with ACF values Reply To: Suggestions for creating dynamic stylesheets with ACF values

  • Hi – here is the way I do it.

    1. Create an option page – something like “Theme Settings”
    2. Add Fields for each css style I need
    3. Group them in tabs for for mobile/tablet/desktop/HD
    4. Define a hook which is fired once the option page is updated
    5. The hook is generating a css file / it updates the css file
    6. include the css file in your theme in function.php

    If you want to go more advanced. Create a vars.less (I am using less and uikit) and compile the css with a less compiler, after the option page is saved. Like this I only load one css file