• Resolved nLahssine

    (@nlahssine)


    Hi there,

    Thank you for this amazing Plugin, I’m trying to create a widgets that uses the (Group_Control_Typography), and I was wondering if there is an options to set the default values like font weight or size…

    Or I should register a new Typography Scheme and how to do that.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Donna Fontenot

    (@cavalierlife)

    I don’t know the answer for that, but maybe the developer docs will help. You can find them at https://developers.elementor.com/

    Thread Starter nLahssine

    (@nlahssine)

    Hi @cavalierlife,

    Thank you for your answer, Yes I have already digged into the docs but it’s really lacking. I have also searched in the Elementor source code but no luck.

    Thread Starter nLahssine

    (@nlahssine)

    After more digging in the code here is the solution

    $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'text_font',
                    'label' => esc_html__('Typography', 'plugin-slug'),
                    'fields_options' => [
                        'font_size' => ['default' =>['size' => 50,'unit' => 'px']],
                        'font_weight' => ['default' => '800'],
                        'typography' => ['default' => 'custom'],
                    ],
                    'selector' => '{{WRAPPER}} .your-element-class',
                ]
            );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Default Fonts’ is closed to new replies.