redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Dynamic CSS

Open miishu opened this issue 12 years ago • 5 comments

Hello Guys,

I want to create dynamic CSS file like style.php with redux. So that I can store the values changed for the style sheet dynamically. Is there anyone to help me on this issue??

I understand that I have to create a style.php file where i will put all my dynamic data saved by redux. Then I need to call a function to generate a static css file from that dynamic css file. But I am loosing way to do this with redux.

Am i missing anything ???

Thanks in advance...

miishu avatar Mar 06 '14 13:03 miishu

Sounds like you might want to uncomment this in the sample config: https://github.com/ReduxFramework/redux-framework/blob/master/sample/sample-config.php#L66

teamcrisis avatar Mar 06 '14 14:03 teamcrisis

teamcrisis is spot on. You want to uncomment the code in the compiler action function. In your field code, you would add 'compiler' => 'body' or whatever css element you want to generate. You can also chain elements should you want to update more than one.

kprovance avatar Mar 07 '14 05:03 kprovance

Thanks teamcrisis and kprovance for your guideline...

I am looking for something very much specific to follow... I found a tutorial to create dynamic css with SMOF(http://aquagraphite.com/2011/11/dynamically-generate-static-css-files-using-php/)

Is there any similar tutorial for redux framework also??

Thanks again

miishu avatar Mar 08 '14 08:03 miishu

@miishu Look in the sample config. I have a function already there that automatically takes the CSS set for compiler and writes a CSS file. I am not sure how much clearer it could be. :-/

dovy avatar Mar 08 '14 09:03 dovy

thanks dovy I will try to implement this.... I am a novice... and a step by step tutorial would be much easier for me.....

miishu avatar Mar 08 '14 09:03 miishu