Customizer and less compiler question


I have created an extra option to select a complementary accent color. ($wp_customize->add_setting, etc). I want to shoot this variable into the static private function _get_less_vars() without touching class-fl-customizer.php so it can be used in the customizer.

When i place this code:

$vars[‘jorrit-accent-color’]= FLColor::hex( $mods[‘jorrit-accent-color’] );
directly into ‘class-fl-customizer.php’

and place this snippet in theme.less:

.bg-complementary {

it works perfectly, but i don’t want that because then the theme isn’t updatable.

Is there a better way, or do you have an example on the best practice to shoot some self created customizer settings(less variables) to the Beaver Builder parent theme so they can be compiled?

Thanks in advance!

Hey Jorrit,

Nice work on adding a new control! To make this future proof, I would recommend outputting your own CSS in the child theme. You can do that by simply echoing CSS via the wp_head action or by compiling your own less similarly to how we’re doing it. Unfortunately, there isn’t a way to do it directly within the Beaver Builder theme at this time.


Hey Justin, thank you for your reply. The wp_head action is what i did, but i don’t like the inline styles in the head :slight_smile: I will give the compiling a try.

Thanks again! Cheers

Hello @Jorrit

I am interested in having some similar functionality. Did you manage to do it?

Thank you!

Hi Carlos!

Sorry to say, but i can’ really help you, i tried it, but i couldn’t get it running just the way i wanted(i am not a php pro). I had it somehow working with another plugin called “wp-less”.

I decided to drop de beaver builder theme and use another theme (Sage sass/bootstrap wordpress theme). This theme has no customizer options but i don’t need really somebody else or a client to decide what colors, fonts and structure the site has to be. This way i can set everything in the variables files and set/create the site structure etc in the .php files myself and have a bit more freedom and i don’t need to write workarounds or overwrites to adapt to the beaver builder theme.

It doens’t mean i don’t like the Beaver Bulder theme, it’s very good! But it just fits better with my worflow to use my own starter theme.

My two cents, kind regards! Jorrit.

Hello Jorrit!

Thank you for your reply. It is a pity you didnt get it working… I will continue digging into it and le t you know if I find anything. Also, maybe the beaver team can pass by and give their advice on this.

Take care!