You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understand it, LESS treats interpolation as "late binding", so :extend() cannot be applied to a selector that has not yet been formed at the parsing stage.
Hello @Bahurtsev! 👋 I'm here to help you with bugs, questions, and becoming a contributor.
To address the documentation error regarding the :extend feature in LESS, the following points should be clarified:
Interpolation and :extend: The documentation should clearly state that :extend cannot be directly applied to selectors formed with variables, as they do not match during parsing. Instead, it should emphasize that :extend can be used with interpolated selectors, which allows for late binding.
Correct Usage Example: The correct way to use :extend with a variable is to define the variable first and then use it in a nested context. For example:
This compiles correctly to include both .bucket and .selector in the output.
Clarification on Media Queries: The documentation should also note that :extend inside @media rules only matches selectors within the same media block and can match nested selectors.
These clarifications will help users understand the correct usage of :extend with interpolated selectors and variables in LESS [1].
Activity
dosubot commentedon Mar 20, 2025
Hello @Bahurtsev! 👋 I'm here to help you with bugs, questions, and becoming a contributor.
To address the documentation error regarding the
:extendfeature in LESS, the following points should be clarified:Interpolation and
:extend: The documentation should clearly state that:extendcannot be directly applied to selectors formed with variables, as they do not match during parsing. Instead, it should emphasize that:extendcan be used with interpolated selectors, which allows for late binding.Correct Usage Example: The correct way to use
:extendwith a variable is to define the variable first and then use it in a nested context. For example:This compiles correctly to include both
.bucketand.selectorin the output.Clarification on Media Queries: The documentation should also note that
:extendinside@mediarules only matches selectors within the same media block and can match nested selectors.These clarifications will help users understand the correct usage of
:extendwith interpolated selectors and variables in LESS [1].To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
matthew-dean commentedon Aug 10, 2025
@Bahurtsev Huh. You're right. Although there's no reason why those two SHOULD produce different output, when they are semantically equivalent.