Question
Does a mixin defined inside a media query hoist to root in Less 4.x?
Zo Sage
0 reputation · 24 Aug 2023, 03:27 UTC
41.5K views0
Goal
Determine whether a mixin declared within an @media block changes its scope between Less 3.x and Less 4.x, and how that impacts the generated CSS.
Constraints
The behavior appears to differ: Less 3.x keeps the mixin scoped to the media query, while Less 4.x may hoist it to the root, altering @media block ordering and specificity when multiple queries coexist.
Questions
- Does the mixin become globally available in Less 4.x?
- How does the compiled
@mediablock ordering differ between Less 3.15 and 4.0? - Which version‑specific flag or configuration controls this hoisting behavior?