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
{{ message }}
Repository navigation
If the child component uses the media query style, it will not be loaded. Why #4331
when we use less version Higher than 4.2.0, the proble is occurred,
which means the media css style of the child component is lost.
but when we use lower version,like 4.2.0,which works very well.
Hey @nicky132! I'm here to help you with any bugs, questions, or contributions you have. Let's get to the bottom of this together!
The issue you're experiencing with media queries not being applied in Less version 4.2.2 might be related to known issues with media query processing in this version. Specifically, there is a known issue where empty @media queries are generated through line comments when compiling a Less file with the (reference) keyword [1].
Additionally, there is a bug in Less.js 4.2.1 where nested @media and @container rules are incorrectly merged instead of maintaining their proper nesting structure [2]. This could potentially affect how media queries are processed in your code.
To address this, you might want to check if your Less code uses any features like @import (reference) or nested media queries that could be causing this issue. If possible, try simplifying the media query structure or reverting to Less version 4.2.0, where the issue does not occur, as a temporary workaround.
Starting in Less 4.2.1 the parser is no longer treating this and as a Keyword and this results in a space not being added, causing selector issues in the end result:
and(max-width:1280px)
I have a fix for the and issue and will send a PR along shortly.
Workaround: Ensure the source has a space after and keyword.
Activity
dosubot commentedon Mar 25, 2025
Hey @nicky132! I'm here to help you with any bugs, questions, or contributions you have. Let's get to the bottom of this together!
The issue you're experiencing with media queries not being applied in Less version 4.2.2 might be related to known issues with media query processing in this version. Specifically, there is a known issue where empty
@mediaqueries are generated through line comments when compiling a Less file with the(reference)keyword [1].Additionally, there is a bug in Less.js 4.2.1 where nested
@mediaand@containerrules are incorrectly merged instead of maintaining their proper nesting structure [2]. This could potentially affect how media queries are processed in your code.To address this, you might want to check if your Less code uses any features like
@import (reference)or nested media queries that could be causing this issue. If possible, try simplifying the media query structure or reverting to Less version 4.2.0, where the issue does not occur, as a temporary workaround.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
puckowski commentedon Mar 25, 2025
There seems to be an issue with the CodeSandbox. @nicky132 Could you take a look at permissions?
nicky132 commentedon Mar 26, 2025
source code:
https://codesandbox.io/p/devbox/j4rj4t
preview:
https://j4rj4t-8001.csb.app/registeProcess
seems fine
puckowski commentedon Mar 26, 2025
You may be able to access the CodeSandbox, but others may not be able to. You likely have to make the sandbox public/shareable.
Trying to access the sandbox yields the message:
Since it exists for you, there is likely a permissions issue.
An alternative would be to just post the problematic Less syntax here so we can take a look.
nicky132 commentedon Mar 26, 2025
public share already set,try again
puckowski commentedon Mar 26, 2025
I can now access the CodeSandbox. I will look for problematic Less in the CodeSandbox project.
puckowski commentedon Mar 27, 2025
I identified some syntax that is problematic starting in Less version
4.2.1(4.2.0is okay):Starting in Less
4.2.1the parser is no longer treating thisandas aKeywordand this results in a space not being added, causing selector issues in the end result:I have a fix for the
andissue and will send a PR along shortly.Workaround: Ensure the source has a space after
andkeyword.Thank you for the bug report @nicky132
puckowski commentedon Mar 27, 2025
I put together a PR which should address the issue I identified from the CodeSandbox: #4332
There are ongoing CI issues, but the tests pass locally.
fix(less#4331): exclude CSS at-rule keywords from declarationCall par…
fix(less#4331): normalize spacing after CSS at-rule keywords in media…
fix(#4331): exclude CSS at-rule keywords from declarationCall parsing (…
Less 5 alpha.1: Jess-powered compiler preview (#19)
Less 5 alpha.1: Jess-powered compiler preview (#4487)