Skip to content

Conversation

puckowski
Copy link
Contributor

What:

Add Less.js support for container queries to style descendants of containers based on their scroll state.

This PR also aims to improve function handling for @media and @container without adding new functions to the function registry as was done in #4311.

With this solution, future CSS functions should work without having to update Less code.

Why:

Container query scroll state support is available in Chrome 133 (https://developer.chrome.com/blog/chrome-133-beta). Getting ahead of broader support. Without this PR the Less.js output of scroll-state is incorrect.

Global support suggests 65.76% availability per https://caniuse.com/?search=scroll-state.

Checklist:

  • Documentation
  • Added/updated unit tests
  • Code complete

* Add support for CSS scroll state container queries.
* Improve at-rule function handling.
* Clean up scroll-state solution code for merge.
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 26, 2025
@puckowski
Copy link
Contributor Author

Closed #4311 in favor of this PR.

This PR adopts the feedback provided for #4311 of not adding functions to the function registry while deferring the broader effort of unifying @container, @media, @support and potentially other at-rules.

@woody-li
Copy link

This PR also aims to improve function handling for @media and @container without adding new functions to the function registry as was done in #4311.

Glad to hear that, looking forward to it.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 24, 2025
@matthew-dean
Copy link
Member

Thanks @puckowski !

@puckowski puckowski merged commit 6e0095d into less:master Jul 25, 2025
7 checks passed
@puckowski
Copy link
Contributor Author

I'll prepare a patch release PR tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants