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.