Fluid Responsiveness
Last updated
Last updated
When users zoom in on their browsers, the site eventually reaches a new breakpoint and sizes adjust to prevent overflowing content. Normally, increasing the font size preference should behave just like browser zoom, triggering those responsive changes. However on Webflow sites, increasing the browser’s font size doesn’t activate the next breakpoint because Webflow uses PX breakpoints instead of REM. As a result, text and element sizes continue to grow and overflow without the responsive adjustments designed for smaller screens.
Using fluid sizing with clamp()
can solve this issue. Since clamp()
isn't based on PX breakpoints, it allows sizes to respond just like they would with browser zoom, delivering a more accessible and consistent experience.
Using autofit grids with fluid sizes can make the experiences of browser zoom and browser font size increase exactly identical.
Any variables can be added into the General Variables. The --site--margin variable controls the horizontal space so that our container doesn't touch the edges of the screen. The --size variables can be used for font sizes, spacing, element sizes, and any other sizes on our site.
Scale Ratio groups are optional. There's groups for heading variables, text variables, & spacing variables. If we delete all heading, text, and spacing variables from the Fluid Builder, their sizes will be defined in the variable panel instead. Scale Ratios are not required for fluid responsiveness. By default heading, text, and spacing variables in the variable panel are connected to the --size variables which are already made fluid through the Fluid Builder.
When using Scale Ratios, we always want to set the size of the smallest variable in the list. Each size is created by multiplying one size below the current size by the scale ratio. In most cases, we don't need to reduce the font size on mobile and instead can just reduce the Mobile Scale Ratio so that all the larger sizes become smaller without affecting the smallest size at all. In some cases, it can be helpful to reduce both the mobile font size of the smallest size and reduce the Mobile Scale Ratio.
For a font size to be accessible, the desktop size can be no larger than 2.5x the mobile size. The same is true for both breakpoint-based font sizes and fluid font sizes. If the desktop font size is larger than 2.5x of the mobile size, the user won't be able to double the font size like required when reaching max browser zoom. If your size variable isn't used for font size, the red error label can be ignored.
The orange warning label should be avoided at all cost for any size variable that could be used as a font size. This label appears when there's a 0rem or negative rem value in the clamp. In these cases the font size won't appear to change at all on zoom or will appear to decrease from an increased zoom until the min font size is reached. Orange warning labels are usually caused by placing the max and min screen sizes too close together. Pushing them further apart usually removes this issue.
Copy the code from the Fluid Builder, and replace everything in the page_code_responsive
embed with this new fluid code. A url containing all your fluid settings will be saved in the embed in case you ever want to update these settings later. This url isn't required for the fluid code to work.