Font Weight Preset Question

I noticed that there is no “Font Weight” option for the Global text in the theme Customizer text section (Customize->General->Text).

I want to know if a font weight can still be applied to a custom preset.

And if so, then what would the array be for that? For example, I want Lato to be font weight 300.

So would it be something like this…?

'fl-body-font-family'		=> 'Lato',
'fl-body-font-weight'		=> '300',

I did find a plugin that does this globally but not sure if it can be applied to a preset.

Please advise.

Hey Luis,

Unfortunately, there is no such option on our theme so you won’t be able to include that in the array. You can find all the array keys under includes/customizer-panel-*.php.

That can still be done though. Instead of placing it in the array, you can place it(and any other additional CSS) under a different CSS file and include it in your preset. Your code then will look like this.

FLCustomizer::add_preset('my-preset', array(
  'name'      => 'My Preset',
  'skin'      => get_stylesheet_directory() . '/preset-styles.css',
  'settings'  => array()
));

Hope this helps!

Ben

Oh o.k. I see.

Makes sense.

Thanks Ben!

Hey Luis,

No worries! Let me know if you need anything further!

Ben

Hey Ben,

For the life of me I can’t make this work. I already went through the documentation and through this thread
http://forum.wpbeaverbuilder.com/support/q/adding-presets/

and still doesn’t work.

my current css style sheet is in
/public_html/demos/demo1/wp-content/themes/bb-theme-child-1/clean-centered.css

I’ve tried writing it like the tutorial says but its not picking up the css. It works fine in the child theme style.css but I need this for a custom preset.

I already tried this…along with different variations.

FLCustomizer::add_preset('my-preset', array(
  'name'      => 'My Preset',
  'skin'      => get_stylesheet_directory() . '/clean-centered.css',
  'settings'  => array()
));

Please advise.

Ben,

This is RESOLVED! Boy do I feel dumb, all along it was an extra } in my css that was causing all the trouble.

Hey Luis,

That’s awesome! Let us know if you need anything further! :slight_smile:

Ben

Hi Ben,

Sorry to open up this thread again. I’m running into a bit of a problem with the font again.

So far I have been able to.

  1. Create my own preset.
  2. Create a separate css style sheet per preset.
  3. Now I know to resave the Preset in the customizer to clear the css cache.

So in my style.css file I have the following code.

/*Content Font Weight*/

.fl-page .fl-page-content {
       font-weight: 300; 
    } 

which is fine because I don’t mind that font weight as a “global” setting for the majority of my presets.

However, on a new preset I created I want the font to be “normal”, which is basically a 400 font weight.

/*Content Font Weight*/

.fl-page .fl-page-content {
       font-weight: normal; 
    } 

When I apply this to that PRESET’s css the font weight does not carry over when saved.

I already went through the customizer and resaved the preset to clear the cache and still no luck.

Not sure if i’m doing something wrong.

Css hero gives me the code above and it works well as i’m doing the changes in CSS hero but as soon as I save CSS hero the font goes back to 300.

Please advise.

Hey Luis,

No worries at all! Since they have the same specificity, it may be possible that styles under the style.css file is given priority. I’d suggest giving the style on your preset a higher specificity. Try using this CSS snippet on your preset.

body .fl-page .fl-page-content {
  font-weight: normal; 
}

Ben

Yes that worked.

Thank You.

Awesome! Have fun with The Beaver! :slight_smile:

Ben