René's URL Explorer Experiment


Title: feat(core): support CSS cascade layers (@layer) by aleclarson · Pull Request #11462 · NativeScript/NativeScript · GitHub

Open Graph Title: feat(core): support CSS cascade layers (@layer) by aleclarson · Pull Request #11462 · NativeScript/NativeScript

X Title: feat(core): support CSS cascade layers (@layer) by aleclarson · Pull Request #11462 · NativeScript/NativeScript

Description: 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? Rules inside @layer blocks are silently dropped: _populateRules (ui/styling/style-scope.ts) only descends into @media at-rules, so every modern build-time CSS pipeline that emits cascade layers (Tailwind v4, Panda CSS, Bamboo, UnoCSS) produces a stylesheet that is dead on NativeScript — see NativeScript/tailwind#197 for the same wall hit from the Tailwind side. What is the new behavior? @layer applies per CSS Cascading and Inheritance Level 5: Parsers: css/css-tree-parser.ts (default __CSS_PARSER__) — @layer nodes keep their prelude (layer name list) alongside nested rules; the statement form (@layer a, b;) parses with no block. css/lib/parse (vendored rework parser) — same support, which also fixes the legacy __CSS_PARSER__=rework runtime path and gives the bundler-side serializers a layer-aware parser to converge on. Ordering (ui/styling/style-scope.ts): a name→ordinal registry shared across all stylesheets feeding the cascade (document-wide, per spec). Statement form pre-declares order; block form registers on first sight; dotted names (a.b) walk ancestors so a top-level @layer a.b refers to the same layer as @layer a { @layer b { … } }; anonymous blocks get synthesized names that can't be re-referenced. Cascade (ui/styling/css-selector.ts): each RuleSet carries layerPath: number[]; compareSelectors compares layer paths before specificity. Unlayered rules carry an infinite rank at every depth, so they always beat layered rules — matching the spec, which also handles nested-layer comparison lexicographically. Imports: @import "x.css" layer(name) (and bare layer for anonymous) nests the imported sheet under that layer. Deliberately not implemented: !important layer-order reversal — NativeScript does not implement !important at all today (cleanupImportantFlags warns and strips), so there is nothing to reverse. @supports/@container/@scope remain dropped (they need real condition evaluation; dropping is safer than unconditional application). Known follow-up (out of scope here) The bundler-side serializers — @nativescript/vite's bundled-css path (helpers/main-entry.ts, parseCssToAst) and webpack's css2json-loader — run the npm css package (reworkcss/css), which misparses @layer into bogus selectors and drops the rules. That package is a separate upstream; swapping those call sites to core's now-layer-aware vendored parser (or css-tree) is the natural follow-up. Tests New ui/styling/css-layer.spec.ts — 13 cases covering population, statement ordering over specificity+position, unlayered-beats-layered, nested/dotted equivalence, anonymous ordering, media queries inside layers, keyframes inside layers, and the same ordering driven through the rework-parser AST end to end. Verified on-device (iOS sim) via a harness probe: a class rule in the later layer beat an id selector in the earlier one, and an unlayered rule beat a layered id selector. Full packages/core suite: 510 tests passing locally. Implements #11461.

Open Graph Description: 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...

X Description: 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...

Opengraph URL: https://github.com/NativeScript/NativeScript/pull/11462

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a33731cf-ed3a-7d54-0572-956a6fc5d6b5
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE11C:1DCB8C:168C79B:1DBEA0C:6B013040
html-safe-nonce911793cec93f313ddca94abf4661ea9b43ef6ee75c23d54384fba981ef945e9a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTFDOjFEQ0I4QzoxNjhDNzlCOjFEQkVBMEM6NkIwMTMwNDAiLCJ2aXNpdG9yX2lkIjoiMjkyNTE5MDY2NTMyNTMyNjQwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0cbe233870d09f7c95e1ce8d6061c3a71e8862964f4b2d7284c74020edd03811
hovercard-subject-tagpull_request:4659212849
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/NativeScript/pull/11462/files
twitter:imagehttps://avatars.githubusercontent.com/u/1925840?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1925840?s=400&v=4
og:image:altPR 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...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id31492490
octolytics-dimension-repository_nwoNativeScript/NativeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31492490
octolytics-dimension-repository_network_root_nwoNativeScript/NativeScript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/NativeScript/pull/11462/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F11462%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F11462%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2FNativeScript
Reloadhttps://github.com/NativeScript/NativeScript/pull/11462/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11462/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11462/files
NativeScripthttps://github.com/NativeScript
NativeScripthttps://github.com/NativeScript/NativeScript
Codehttps://github.com/NativeScript/NativeScript
Issues231 (231)https://github.com/NativeScript/NativeScript/issues
Pull requests107 (107)https://github.com/NativeScript/NativeScript/pulls
Discussionshttps://github.com/NativeScript/NativeScript/discussions
Actionshttps://github.com/NativeScript/NativeScript/actions
Projectshttps://github.com/NativeScript/NativeScript/projects
Wikihttps://github.com/NativeScript/NativeScript/wiki
Security and qualityhttps://github.com/NativeScript/NativeScript/security
Insightshttps://github.com/NativeScript/NativeScript/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
aleclarsonhttps://github.com/aleclarson
NativeScript:mainhttps://github.com/NativeScript/NativeScript/tree/main
aleclarson:feat/css-cascade-layershttps://github.com/aleclarson/nativescript/tree/feat/css-cascade-layers
Conversation 2 https://github.com/NativeScript/NativeScript/pull/11462
Commits 3 https://github.com/NativeScript/NativeScript/pull/11462/commits
Checks 5 https://github.com/NativeScript/NativeScript/pull/11462/checks
Files changed https://github.com/NativeScript/NativeScript/pull/11462/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11462/files
feat(core): support CSS cascade layers (@layer) https://github.com/NativeScript/NativeScript/pull/11462/files#top
Show all changes 3 commits https://github.com/NativeScript/NativeScript/pull/11462/files
928df25 feat(core): support CSS cascade layers (@layer) aleclarson Sep 28, 2026 https://github.com/NativeScript/NativeScript/pull/11462/commits/928df2525778eb904bbf563e09f455d0f5b5442c
4182f37 feat(core): parse @layer in the vendored rework parser aleclarson Sep 28, 2026 https://github.com/NativeScript/NativeScript/pull/11462/commits/4182f37f5d2de702080770ef838a3a73ebfc3fd4
ea301ba fix(core): parse @import layer() sheets inside their layer NathanWalker Oct 6, 2026 https://github.com/NativeScript/NativeScript/pull/11462/commits/ea301baa41a79a0b9335406585841748506640b5
Clear filters https://github.com/NativeScript/NativeScript/pull/11462/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11462/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11462/files
css-tree-parser.ts https://github.com/NativeScript/NativeScript/pull/11462/files#diff-1ae2dcc7e254462a4820c7e6e0f67a41e2002def0ec1d31ec95f1cc8a9cf97c6
index.ts https://github.com/NativeScript/NativeScript/pull/11462/files#diff-dd5b6e97e01c978ccadfcafb4401cdfa1c3687676574f06dae417ada7fa69861
reworkcss.ts https://github.com/NativeScript/NativeScript/pull/11462/files#diff-ef3fa9850b56b909570a861316eb46adcd017864fc628324d2c7d215e35abac0
css-layer.spec.ts https://github.com/NativeScript/NativeScript/pull/11462/files#diff-0f31281ce30a7e9743fa19c79faa4fa6e47e927881695fdf193023ec3019f823
css-selector.ts https://github.com/NativeScript/NativeScript/pull/11462/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
style-scope.ts https://github.com/NativeScript/NativeScript/pull/11462/files#diff-c9f6d61e7dbc2518a8583def66f2006ffc9759770355a985971ba4657b0e7e30
packages/core/css/css-tree-parser.tshttps://github.com/NativeScript/NativeScript/pull/11462/files#diff-1ae2dcc7e254462a4820c7e6e0f67a41e2002def0ec1d31ec95f1cc8a9cf97c6
View file https://github.com/NativeScript/NativeScript/blob/ea301baa41a79a0b9335406585841748506640b5/packages/core/css/css-tree-parser.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11462/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-1ae2dcc7e254462a4820c7e6e0f67a41e2002def0ec1d31ec95f1cc8a9cf97c6
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-1ae2dcc7e254462a4820c7e6e0f67a41e2002def0ec1d31ec95f1cc8a9cf97c6
packages/core/css/lib/parse/index.tshttps://github.com/NativeScript/NativeScript/pull/11462/files#diff-dd5b6e97e01c978ccadfcafb4401cdfa1c3687676574f06dae417ada7fa69861
View file https://github.com/NativeScript/NativeScript/blob/ea301baa41a79a0b9335406585841748506640b5/packages/core/css/lib/parse/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11462/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-dd5b6e97e01c978ccadfcafb4401cdfa1c3687676574f06dae417ada7fa69861
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-dd5b6e97e01c978ccadfcafb4401cdfa1c3687676574f06dae417ada7fa69861
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-dd5b6e97e01c978ccadfcafb4401cdfa1c3687676574f06dae417ada7fa69861
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-dd5b6e97e01c978ccadfcafb4401cdfa1c3687676574f06dae417ada7fa69861
packages/core/css/reworkcss.tshttps://github.com/NativeScript/NativeScript/pull/11462/files#diff-ef3fa9850b56b909570a861316eb46adcd017864fc628324d2c7d215e35abac0
View file https://github.com/NativeScript/NativeScript/blob/ea301baa41a79a0b9335406585841748506640b5/packages/core/css/reworkcss.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11462/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-ef3fa9850b56b909570a861316eb46adcd017864fc628324d2c7d215e35abac0
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-ef3fa9850b56b909570a861316eb46adcd017864fc628324d2c7d215e35abac0
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-ef3fa9850b56b909570a861316eb46adcd017864fc628324d2c7d215e35abac0
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-ef3fa9850b56b909570a861316eb46adcd017864fc628324d2c7d215e35abac0
packages/core/ui/styling/css-layer.spec.tshttps://github.com/NativeScript/NativeScript/pull/11462/files#diff-0f31281ce30a7e9743fa19c79faa4fa6e47e927881695fdf193023ec3019f823
View file https://github.com/NativeScript/NativeScript/blob/ea301baa41a79a0b9335406585841748506640b5/packages/core/ui/styling/css-layer.spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11462/{{ revealButtonHref }}
packages/core/ui/styling/css-selector.tshttps://github.com/NativeScript/NativeScript/pull/11462/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
View file https://github.com/NativeScript/NativeScript/blob/ea301baa41a79a0b9335406585841748506640b5/packages/core/ui/styling/css-selector.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11462/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11462/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11462/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11462/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.