GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(core): evaluate @supports conditions instead of dropping their rules by edusperoni · Pull Request #11592 · NativeScript/NativeScript

Conversation

@edusperoni

@edusperoni edusperoni commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

  • The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages.
  • There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
  • You have signed the CLA.
  • All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#running-unit-tests-application.
  • Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md.

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.

All reactions
@edusperoni
feat(core): evaluate @supports conditions instead of dropping their r…
1d26c38
…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

nx-cloud Bot commented Oct 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pkg-pr-new

pkg-pr-new Bot commented Oct 29, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This branch has not been deployed

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

1 participant

@edusperoni
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.