Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

At-rule declarations may go missing are or incorrectly merged under certain nesting conditions #4301

Open
puckowski opened this issue Dec 19, 2024 · 3 comments

Comments

@puckowski
Copy link
Contributor

@jpattishall-ebay raised an issue in #4267 (comment) where they noted @media and @container are not properly nesting in some cases.

Currently I see in 4.2.1 Playground I see this:

@media only screen and (min-width: 768px) {
  @container (min-width: 500px) {
    .primary-content {
      font-size: 1rem;
    }
  }
}

results in:

@container only screen and (min-width: 768px) and (min-width: 500px) {
  .primary-content {
    font-size: 1rem;
  }
}

But I see 4.1.3 produced the expected output:

@media only screen and (min-width: 768px) {
  @container (min-width: 500px) {
    .primary-content {
      font-size: 1rem;
    }
  }
}
@puckowski puckowski added the bug label Dec 19, 2024
@puckowski
Copy link
Contributor Author

I believe I have a fix for this issue, I will try to prepare a PR to this repo by Friday 12/20/24. I need a little more time to test.

puckowski added a commit to puckowski/less.js that referenced this issue Dec 19, 2024
* Fixes issue less#4301. At-rule declarations may go missing or are
  incorrectly merged under certain nesting conditions.
* Added more ```@container``` tests.
@puckowski
Copy link
Contributor Author

PR #4302 should resolve this issue.

@puckowski
Copy link
Contributor Author

If anyone needs a workaround for this issue in the short term you may be able to use https://github.com/puckowski/less.js/releases/tag/4.2.1.5

The fork release is Less.js 4.2.1 with fixes for:
#4301
#4252
#3737
#4258
#4264
#4268
#4267
#3777
#4224

Supports @starting-style and @scope at-rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant