Hequalizer’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/soyleninjs/hequalizer/llms.txt
Use this file to discover all available pages before exploring further.
responsive option lets you provide a different set of options for each viewport width range. This is essential for grid layouts where the number of visible columns changes at various breakpoints — your height equalization should match the actual column count at every size.
The responsive option
Pass an object keyed by numeric breakpoints (in pixels). Each value is a partial options object that overrides the base configuration when that breakpoint is active:
main.js
How breakpoints are matched
When the window resizes (or on first load), Hequalizer sorts all breakpoints from smallest to largest, then finds the first one wherewindow.innerWidth <= breakpoint. That becomes the active breakpoint.
If no breakpoint matches — meaning the viewport is wider than all defined breakpoints — Hequalizer uses the base "default" configuration.
The currently active breakpoint is always available on the actualBreakpoint property:
actualBreakpoint is "default" when no breakpoint applies, or the matching breakpoint number otherwise.
Viewport-to-breakpoint mapping
Using the configuration from the example above, the resulting behavior at each viewport width is:| Viewport width | Active breakpoint | Effective options |
|---|---|---|
| ≤ 480px | 480 | columns: 1 |
| 481px – 768px | 768 | columns: 2, cssVariable: '--product-title-height-tablet' |
| 769px – 1024px | 1024 | columns: 3 |
| > 1024px | default | columns: 4 |
Breakpoints are evaluated as less than or equal to (
<=), so a viewport of exactly 768px activates the 768 breakpoint, not 1024.CSS variable cleanup across breakpoints
When you assign a differentcssVariable at a specific breakpoint, two different CSS custom properties may be set on your elements across viewport changes. Hequalizer prevents stale values by tracking every CSS variable name used in any breakpoint — stored in the cssVariables array — and removing all of them before each recalculation:
_cleanHeightElements() calls element.style.removeProperty() for each variable in that array. This means switching from the tablet breakpoint back to desktop never leaves --product-title-height-tablet lingering on the element.
Corresponding CSS for per-breakpoint variables
Write onemin-height rule per variable, scoped to the correct media query:
styles.css
min-height declaration to apply, and Hequalizer ensures only the correct variable has a value at any given time.
Full responsive example
Disabling equalization at mobile breakpoints
main.js