• WordPress → Mega Menu → Menu Themes → My Main Theme → Custom Styling:

    /** Fluid typography **/
    
    .max-mega-menu > li.mega-menu-item > a.mega-menu-link {
    	font-size: clamp(0.75rem, 0.333rem + 1.042vw, 1rem) !important;
    	/* Min at 640px. Max at 1024px*/
    }

    In the frontend output this arrives as:

    clamp(0.75rem, 1.375rem, 1rem) !important

    So during “CSS file processing/generation” the middle part of the clamp expression 0.333rem + 1.042vw got evaluated into 1.375rem (seems to have simply dropped the VW unit entirely and then did a simply addition and then returned the result with a rem unit) instead of leaving that formula for the web browser to calculate on the fly for whatever the viewport is.

    Workaround:

    functions.php which enqueues my custom CSS file which has it.

    • This topic was modified 1 year, 5 months ago by abitofmind.
  • The topic ‘Mega Menu: Custom CSS clamp expression gets mangled instead of passthrough’ is closed to new replies.