Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property SureCart\Licensing\Updater::$cache_key is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/pac-wp-inbox/inc/licensing-sdk/Updater.php on line 22

Deprecated: Creation of dynamic property WOO_SL_functions::$query_vars is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/woocommerce-software-license/include/class.sl.functions.php on line 35

Deprecated: Creation of dynamic property WOO_SL::$licence is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/woocommerce-software-license/include/class.sl.php on line 21

Deprecated: Creation of dynamic property WOO_SL_functions::$query_vars is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/woocommerce-software-license/include/class.sl.functions.php on line 35

Deprecated: Return type of GeoIp2\Model\AbstractModel::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/termageddon-usercentrics/vendor/geoip2/geoip2/src/Model/AbstractModel.php on line 63

Deprecated: Return type of GeoIp2\Record\AbstractRecord::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/termageddon-usercentrics/vendor/geoip2/geoip2/src/Record/AbstractRecord.php on line 57

Deprecated: Automatic conversion of false to array is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/divi-social-sharing-buttons/includes/modules/SharingButton/SharingButton.php on line 115

Deprecated: Creation of dynamic property DMB_Module_Code_Snippet::$icon is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1403

Deprecated: Creation of dynamic property DMB_Module_Code_Snippet::$whitelisted_fields is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1403

Deprecated: Creation of dynamic property DMB_Module_Code_Snippet::$fields_defaults is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1403
How To Use CSS Clamp For Fluid Typography In Divi With The Divi Responsive Helper Plugin - Pee-Aye Creative

Deprecated: Creation of dynamic property ET_Builder_Module_Comments::$et_pb_unique_comments_module_class is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1403

Subscribe On YouTube

Join other subscribers and enjoy other Divi video tutorials!

How To Use CSS Clamp For Fluid Typography In Divi With The Divi Responsive Helper Plugin

Nelson Miller Profile Orange
In this tutorial I will give you an overview of CSS clamp and show you how to use it in Divi to make responsive fluid typography.

Deprecated: Use of "parent" in callables is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/divi-module-code-snippet/divi-shim/class_DBCS_Builder_Module_3_1.php on line 165

Deprecated: Use of "parent" in callables is deprecated in /home/292293.cloudwaysapps.com/ejxumdpjev/public_html/wp-content/plugins/divi-module-code-snippet/divi-shim/class_DBCS_Builder_Module_3_1.php on line 158

▶️ Please watch the video above to get all the exciting details! 👆

What Is CSS Clamp?

This is not a course on CSS clamp, it’s a tutorial of how to use it in Divi with our plugin. You can check out tons of other general CSS related resources to learn CSS clamp in-depth, but I’ll give you just the basics of what you need to know if you are new to this. You can also check out some articles on the Elegant Themes blog like this one about making modules responsive. The limitation is that you would need to do it for every module, unlike our plugin which does it once across the entire site. They also have this article about other fluid text options, #6 being about clamp.

CSS clamp allows us to linearly scale text between a set of minimum and maximum sizes as the viewport’s width increases and decreases. The goal is to make the size of an element (or in this case, text size) more predictable. CSS clamp is able to set responsive unit sizes without any media queries. The function uses 3 parameters in a single line, which form a perfect solution for fluid typography. The clamp() function has everything, a starting point to set the minimum font size, a middle area to set the fluid font size, and an ending point to set the maximum font size.

CSS Clamp illustration in Divi by Pee Aye Creative
text-size: clamp(minimum, preferred, maximum);

    Minimum – this fixed value is the minimum threshold for the element and cannot go lower than this. Keep this value in mind as the smallest font size you want for Phone sizes.

    Preferred – this dynamic relative value is what will be outputted unless this value falls below the minimum or above the maximum.

    Maximum – this pixel value is the maximum threshold for the element and cannot go higher than this. Keep this value in mind as the largest font size you want for Desktop sizes.

    Can CSS Clamp Be Used In The Divi Builder?

    No, not with the Divi Builder settings, the input fields will not accept it. The only way you could is by writing the CSS in the Advanced tab of every module, which is quite ridiculous. The one article from the Elegant Themes blog talks about this some. But I have to ask, why make it difficult? At that point, I wouldn’t even bother.

    How To Use CSS Clamp In Divi With The Divi Responsive Helper Plugin

    Now for the good news. It’s very easy and afters the entire site instantly with our Divi Responsive Helper plugin!

    Divi Responsive Helper Plugin by Pee Aye Creative

    Simply choose the clamp parameters you want to use and write or paste them into the font size fields in our plugin settings. Go to Divi>Themes Options>Divi Responsive Helper>Typography.

    example of CSS clamp in Divi using rem units

    You can see in that screenshot that I am using rem units, and that is because it works great in our specific situation, since we have three input fields. If you use pixel values, that works too, but because our plugin settings have an input for each device, it means you need to be more creative with the units like this:

    example of CSS clamp in Divi using pixel unites

    But this is very easy to adjust. And of course you can set the font size for all the headings H1-H6 and for paragraph text, and it only takes a few seconds and it will affect all text on the entire site. Check the video to see how perfectly smooth the text scales from small to big as the viewport changes! Pretty cool?

    Categories: Divi CSS Tutorials

    Subscribe For More Things Like This!

    At the start of each month, we send out a recap newsletter from the month before with family news, Divi news, our latest tutorials, and product news. Occasionally, if the news is too exciting to wait, we will send out another email separate from the monthly newsletter. That’s what you get when you subscribe, and of course you can unsubscribe if you are no longer interested!

    Blog Post Optin
    Divi Logo (2)

    Shop Our Divi Products

    Plugins • Courses • Templates

    Visit The Shop

    Featured Products

    Divi Tutorials On YouTube

    Our videos have views! Join subscribers and enjoy over video tutorials!

    Visit Our Channel

    Leave A Response!

    By commenting you agree to our Blog & YouTube Comments Policy

    17 Comments

    1. ron

      Hi Nelson. Great post I was looking for a long time. Thanks for that

      I managed the settings in the Responsive pliugin for all H1-6 font sizes and it worked very well. Also with the help of this tutorial: https://www.fluid-type-scale.com/ 😉

      However, the paragraph font-size is not fluid. How do I set these in the plugin??

      Thanks for your help and keep up the good work.

      regards, Ron

      Reply
        • Ron Linders

          I know where it is located but paragraph text sizes for not change.
          They is no overwriting with non standard sizes. I am confused..

        • Nelson Lee Miller (aka The Divi Teacher) <span class="comment-author-role-label"><a href="https://www.peeayecreative.com/product/divi-adventure-club/" class="comment-author-role-link" rel="external nofollow" target="_blank">Divi Adventure Club Member</a></span>

          You will need to remove any other preset/customization to the font size, that’s how our settings work. the feature works, just need to make sure it has priority so if you have any adjustment in the modules, it is designed that way on purpose to override ours.

    2. ron

      as I said, I have no customizations. still no succes with paragraph.

      Reply
    3. clarky

      Do you have a toturial for copy to clipboard? same as what you are using in the tutorial on the top?

      Reply
    4. Neil

      Hi Nelson, Thanks for this tutorial. I’ve been grappling with Clamp and using it in combination with Calc for quite a while now, looking for that magic bullet solution. The problem I’ve always found is trying to determine a way to calculate the ‘preferred’ value without trial and error.
      I’d like to have it so that at the max viewport width e.g. 1920px it is the max value in Clamp. Then is scales down linearly to the tablet break point at 980px. What I’m finding though is that unless the preferred value is correct it will reach the max or min values before the upper and lower breakpoints.

      I currently use a Calc equation in the preferred value that works perfectly but it is very time consuming putting it in all the modules for the three different Divi screen sizes as you pointed out in your video.

      So I guess in summary, how do ‘you’ determine the preferred value?

      Thanks

      Reply
    5. Leslee Langlands

      Thanks for this! It was happenstance that I was looking into clamp the same day you posted this!

      My question is, do you need to set clamp for each of the three displays? I thought that if you set the max to what your desktop would be, and your min to what you phone would be, would it not fill in the rest and you would not need the other two?

      Thanks so much! Love your tutorials.

      Reply
    6. David

      thanks nelson for the tutorial, I need to ask you something, with this plugin if you want an h1 to have different sizes on a desktop computer screen, for example 1024/1366/1920, it would only be enough for me to use the “H1 Heading Text Size” field – Desktop” the following values: clamp(15px, 20px, 30px)?

      Reply
    7. Laurie Williams

      Thanks so much for the Divi responsive plugin. Saved me a LOT of time and a headaches.

      Reply

    Submit a Comment

    Your email address will not be published. Required fields are marked *

    Recent Posts

    0

    Your Cart