Responsive text

Hello,

how can I control responsive text parameters? BeTheme allows only on/off switch for making text responsive. This is nice as all type on page gets scaled proportionally. However, there's no way to control the ratio and for smartphones line-height gets too low to make text readable.

How do you control it? Is it JavaScript based or CSS? Where can I find the exact CSS rules or script that governs this behaviour? I'd like to tweak it. I had a quick dash through responsive.css but haven't found anything of value.

Comments

  • Ok, I've found it on line 270 in style.php.

    Basically you're using hardcoded $min_size, $min_line and $multiplier.

    I'd recommend migrating those three variables to Responsive Options in BeTheme Options so that they can be user defined.

    I'd be happy if I could set $min_size to 14, $min_line to 20 and slightly higher multipliers, so that text doesn't shrink too much.

    For now - can I overwrite those variables from child theme's functions.php?
  • Hey,
    yes you can, if you use the child theme then you will be able to update the theme without losing the changes
    thanks
  • Hello,

    simply placing style.php in my child theme and making edits doesn't work. How can I invoke it without altering too much theme code?
  • edited November 2017
    Ok, so this code works when placed in child theme's functions.php:

    function szde_responsive_styles() {
        echo '<!-- Dynamic responsive styles override -->'."\n";
        echo '<style id="mfn-dnmc-style-css-modified">'."\n";
        ob_start();
        
        include( get_stylesheet_directory() . '/style.php' );
        
        $szde_css = ob_get_contents();
        
        ob_get_clean();
        
        echo mfn_styles_minify( $szde_css ) ."\n";
        echo '</style>'."\n";
    }
    add_action( 'wp_head', 'szde_responsive_styles', 100 );


    But the theme still loads and outputs default style.php, which isn't the best solution on earth (CSS overwriting the same CSS). Since you're conditionally loading bunch of styles in theme-head.php I doubt that a more elegant solution is easily achievable with child theme.

    Again - I'd recommend porting $min_size, $min_line and corresponding $multiplier to Muffin Options framework, so that responsive type settings are easily tweakable.
  • Hi,

    What you ask for, requires files customization what in reference to Item Support Policy is not allowed. So if you want to modify files and don't know how, you should contact your web developer. Item Policy says:
    Item support does not include services to modify or extend the item beyond the original features, style, and functionality described on the item page. For customization services that will help you tailor the item to your specific requirements, we recommend contacting the author to see if they privately offer paid customisation services or checking out the great service providers on Envato Studio

    thanks
  • Yeah, I get it.
Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.