← 输入框|github.com|刷新
Skip to content

fix(core): make background: none clear the background color - #11536

Merged
triniwiz merged 2 commits into
mainfrom
fix/background-none
Oct 24, 2026
Merged

triniwiz merged 2 commits into
mainfrom
fix/background-none

Conversation

@triniwiz

@triniwiz triniwiz commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

PR Checklist

What is the current behavior?

background: none changes nothing: the background parser does not accept the none keyword, so the shorthand fails to expand and none of the background longhands change. A native control such as a button keeps its own background (e.g. Bootstrap's .nav-link pills, or any CSS reset that clears button backgrounds).

What is the new behavior?

  • The background parser reads none as the image component.
  • The background shorthand maps it to no image and, unless the declaration also gives a color, to a transparent background-color, the initial value CSS resets it to.
  • Shorthands that only give an image, repeat or position still leave background-color unset, so views keep their native default background behind an image (e.g. the iOS Page's white).

Tests: 3 parser cases in css/parser.spec.ts and 4 specs in ui/styling/style-properties.spec.ts. apps/automated gains test_setting_background_none_from_CSS_makes_backgroundColor_transparent.

Verified with all of these core PRs merged together (#11527–#11537): apps/automated passes on the iOS 26.4 simulator (1830 OK, 0 failed) and on an Android API 36 emulator (1692 OK; the one failure is the network-dependent IMAGE-CACHE.test_ImageCache_ValidUrl timeout, which also passes on reruns).

@nx-cloud

nx-cloud Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit d1f2985

Command Status Duration Result
nx run-many -t build -p core,webpack5,vite ✅ Succeeded 23s View ↗

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


☁️ Nx Cloud last updated this comment at 2026-10-15 20:37:00 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

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

commit: d1f2985

`background: none` left background-color unset, so a native control such
as a button kept its own background. The shorthand parser did not accept
the `none` keyword at all, so the declaration failed to expand and none of
the background longhands changed.

The background parser now reads `none` as the image component, and the
`background` shorthand maps it to no image and, unless the declaration
also gives a color, to a transparent background-color, the initial value
CSS resets it to. Shorthands that only give an image, repeat or position
still leave background-color unset, so views keep their native default
background behind an image.
@triniwiz
triniwiz force-pushed the fix/background-none branch from fce6c07 to cda7bbf Compare October 15, 2026 13:17
@triniwiz
triniwiz merged commit 67bf7ee into main Oct 24, 2026
9 of 10 checks passed
@triniwiz
triniwiz deleted the fix/background-none branch October 24, 2026 01:03
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