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 — fix(core): unresolved var() unsets the whole value and invalid color-mix() no longer renders white by edusperoni · Pull Request #11593 · 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?

  • argbFromColorMix() returns -1 when @csstools/css-color-parser cannot parse the value, and ColorBase stores it as the color. That is opaque white on Android, and transparent blue (invisible) on iOS, which builds the color from the r/g/b/a getters.
  • The usual trigger is an unresolved variable nested in a function. _evaluateCssVariableExpression substitutes unset inline, so color-mix(in srgb, var(--missing) 35%, transparent) becomes color-mix(in srgb, unset 35%, transparent), which fails to parse.
  • The same inline substitution makes calc(var(--missing) + 10) evaluate to 10.

What is the new behavior?

This follows the CSS spec:

  • Unresolved var(): a var() with no value (undefined, empty, or unset) and no fallback that resolves makes the whole declaration invalid at computed-value time, so the property is unset. This holds wherever the var() is nested: color-mix(), calc(), shorthands, multi-value strings. An unresolved var() inside the fallback of a var() that did resolve is ignored, as in browsers: var(--defined, var(--missing)) gives --defined.
  • Malformed color-mix(): throws Invalid color: <value>, like every other unparseable color string. The cascade already catches and traces that, so the declaration is dropped instead of painting white.

Behavior changes:

  • calc(var(--missing) + 10) is now unset instead of 10.
  • margin: var(--a) var(--missing) now unsets the whole shorthand instead of only the missing part.
  • The color-mix(in --swop5c, red, blue) spec used to assert the decoded -1 sentinel. It is now a throw case: without a color profile the value cannot be parsed, and browsers drop it too.

Sorry, something went wrong.

Uh oh!

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

All reactions
@edusperoni
fix(core): unresolved var() unsets the whole value and invalid color-…
c4b4ac1
…mix() no longer renders white

A var() referencing an undefined or empty custom property, with no
fallback or with a fallback that also fails to resolve, now makes the
whole declaration unset, as CSS specifies for values that are invalid at
computed-value time. Before, `unset` was substituted inline, so values
like `color-mix(in srgb, var(--missing) 35%, transparent)` turned into
an unparseable color, and `calc(var(--missing) + 10)` evaluated to 10.

A color-mix() that fails to parse now throws `Invalid color: <value>`
like every other malformed color string, so the declaration is dropped.
Before, the parser's -1 sentinel was stored as the color, which renders
as white on Android and transparent blue on iOS.
@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 7880788

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 53s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded 9s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-29 16:56:58 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 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11593
npm i https://pkg.pr.new/@nativescript/vite@11593
npm i https://pkg.pr.new/@nativescript/webpack@11593

commit: 7880788

All reactions

Sorry, something went wrong.

Uh oh!

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

@edusperoni
edusperoni marked this pull request as ready for review October 29, 2026 15:39
@edusperoni
test(core): expect malformed color-mix() to be rejected in device tests
8b9e7e6
@NathanWalker NathanWalker mentioned this pull request Oct 29, 2026
fix(core): css var() fallbacks, order-independent custom properties, and no crash on unresolvable ones #11527
Merged
3 of 5 tasks
@NathanWalker
Merge remote-tracking branch 'origin/main' into pr-11593
7880788
# Conflicts:
#	packages/core/ui/core/properties/css-variable-expression.spec.ts
@NathanWalker
NathanWalker merged commit c7f905d into main Oct 29, 2026
10 checks passed

Uh oh!

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

@NathanWalker
NathanWalker deleted the fix/color-mix-invalid-not-white branch October 29, 2026 17:09
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.

2 participants

@edusperoni @NathanWalker
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.