Skip to content

feat: add @container to recognized directives/@-rules#453

Open
wridgeu wants to merge 1 commit intoSAP:mainfrom
wridgeu:less-container-query-support
Open

feat: add @container to recognized directives/@-rules#453
wridgeu wants to merge 1 commit intoSAP:mainfrom
wridgeu:less-container-query-support

Conversation

@wridgeu
Copy link
Copy Markdown

@wridgeu wridgeu commented Mar 24, 2026

The vendored preprocessor does not recognize @container, causing parse errors when UI5 libraries use CSS container queries for responsive component sizing. This commit adds @container to the directive switch alongside @supports and @keyframes so it passes through correctly during preprocessing.

CSS Container Queries are a W3C standard supported in all major browsers since 2023

see: https://caniuse.com/css-container-queries

A workaround currently, to still make use of the container queries, is using the inline import to import a secondary .css file which then bypasses the less parser.

@import (inline) ...

ps: I wasn't sure if that counts as feature or simple chore ..

The vendored preprocessor does not recognize @container,
causing parse errors when UI5 libraries use CSS container queries for
responsive component sizing. This commit adds @container to the directive switch
alongside @supports and @Keyframes so it passes through correctly
during preprocessing.

CSS Container Queries are a W3C standard supported in all major
browsers since 2023

see: https://caniuse.com/css-container-queries
@flovogt flovogt self-assigned this Mar 25, 2026
@flovogt
Copy link
Copy Markdown
Member

flovogt commented Mar 27, 2026

@wridgeu Thanks a lot for your contribution. I highly appreciate your enhancement. The whole LESS and theming functionality for UI5 involves several teams at SAP and we have to ensure all involved parties are aligned. I will take this topic to the corresponding teams and will update the issue here as soon as I can share further news.

@wridgeu
Copy link
Copy Markdown
Author

wridgeu commented Mar 27, 2026

@flovogt thank you very much!

I also have a local patch applied to allow for @layer usage (see https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@layer).

But it's more than a simple addition to the case statement to support the various ways it can be written/used.

I'm not adding a PR for that one though because I'm not sure what the plans are for supporting more up to date less versions (or updating the internally used one in general) in the future.

Are there any insights you can give me regarding this? Or maybe there's a way to have the tooling pick up/use a more recent less version with some minor modifications?

@flovogt
Copy link
Copy Markdown
Member

flovogt commented Mar 28, 2026

You're absolutely right. We are still using an old version of LESS. We have an eye on the overall LESS strategy and will discuss this topic over the next weeks. I will keep you up-to-date.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants