New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elementor Typography Control Default Values #5022
Comments
Typography control is a field control so it accepts a $this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => __( 'Title Typography', 'my-plugin-domain' ),
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} h3',
'fields_options' => [
// Inner control name
'font_weight' => [
// Inner control settings
'default' => '500',
],
'font_family' => [
'default' => 'Rubik',
],
'font_size' => [
'default' => '14px',
],
],
]
); But you should set the defaults in CSS like we do so you don't store default values in the database. |
Whole idea behind this solution is fine just provided example contain an error, you can't define: It should be: |
This is not loading the custom typography until you click on Typography edit icon. Any help? |
So, the solution i figured out is the following:
|
@bainternet , why are the default values stored in database? Aren't they fetched when the page loads? |
how to add a new option (small caps) in Typography >> Transform drop down. Is there any hook in elementor to inject this option ? I am doing this with my custom elementor widget |
I'm developer and I want to add Typography Control with its default values for title (h3) to my widget.
I want to enter all typography control default values as:
Font Family, Font Size, Font Weight, TextTransform, Font Style, Text Decoration, Line Height and Letter Spacing.
Please, help with this.
The text was updated successfully, but these errors were encountered: