GeezerVison is showing github.com — feat(core): evaluate @supports conditions instead of dropping their rules by edusperoni · Pull Request #11592 · NativeScript/NativeScript
Conversation
PR Checklist
What is the current behavior?
Both CSS parsers (css-tree, and rework / webpack's css2json) emit @supports blocks, but _populateRules only handles @media, @keyframes and plain rules, so every rule inside an @supports block is silently dropped. A common progressive-enhancement pattern does nothing:
.card { background-color: #e0e0e0; }
@supports (color: color-mix(in srgb, red, blue)) {
.card { background-color: color-mix(in srgb, var(--accent) 20%, white); }
}
What is the new behavior?
@supports conditions are evaluated when the stylesheet is built (ui/styling/css-supports.ts):
(property: value) passes when core knows the property and that property's own value converter accepts the value. (color: color-mix(...)) is true because Color parses color-mix(), while (display: grid) is false. var() / calc() values, CSS-wide keywords and custom properties pass, matching browsers.
selector(...) passes when core's selector parser accepts it.
not / and / or and nested parentheses follow css-conditional-3. Mixing and/or without parentheses, or any other malformed condition, drops the block.
- Unknown properties and unknown functions (
font-tech(), etc.) evaluate to false. That keeps them negatable, so @supports not (display: grid) applies. Unknown or invalid conditions log a Trace warning in the Style category.
A supported block is flattened into the surrounding rule list, so its rules keep their source position and override an earlier fallback by order, inside @media too. @keyframes inside @supports work.
To support the declaration test, properties/index.ts now records each CssProperty value converter by CSS name, updated by overrideHandlers, and exposes _isCssDeclarationSupported. Shorthands and CssAnimationProperty use their existing converters.
Notes:
- Support follows each property's converter. A property whose converter accepts any string reports any value as supported, and a converter that returns
NaN counts as unsupported.
- A property registered by a module that has not loaded yet when the stylesheet is parsed reports as unknown.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ules
@supports blocks were parsed but never reached the cascade, so their rules
were silently lost. Conditions are now evaluated when the stylesheet is
built:
- (property: value) passes when core knows the property and its value
converter accepts the value, so (color: color-mix(...)) is true and
(display: grid) is false. var() and calc() values pass.
- selector(...) passes when core parses the selector.
- not / and / or and nested parentheses follow css-conditional-3; unknown
tests and functions evaluate to false (and can be negated), and a
malformed condition drops the block. Both log a Trace warning.
Supported blocks are flattened in place, so their rules keep their source
position and override an earlier fallback by order.
nx-cloud
Bot
commented
Oct 29, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
View your CI Pipeline Execution ↗ for commit 1d26c38
| Command |
Status |
Duration |
Result |
nx test apps-automated -c=android |
✅ Succeeded |
3m 22s |
View ↗ |
nx run-many --target=test --configuration=ci --... |
✅ Succeeded |
<1s |
View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-10-29 14:46:22 UTC
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Open in StackBlitz
npm i https://pkg.pr.new/@nativescript/core@11592
npm i https://pkg.pr.new/@nativescript/vite@11592
npm i https://pkg.pr.new/@nativescript/webpack@11592
commit: 1d26c38
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|