Tailwind v4 parity gaps: stale allowlist strips core-supported props, all @media dropped, hidden→collapse rewrite is wrong on modern core
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, tailwindcss
- Bereich
- frontend, mobile-dev, tooling
Rechercherichtung
Start in src/removeUnsupported.js, including the supportedProperties allowlist, visibility rewrite, and mediaAtRule handling. Compare those paths with the NativeScript core files named in the issue, then work through the suggested order and verify the listed gap, media, visibility, translate, and scale utilities retain the supported behavior while unsupported features remain documented or dropped.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
We've been auditing @nativescript/tailwind's removeUnsupported pass against @nativescript/core 9.x with the goal of Tailwind parity between web and NativeScript wherever core makes it possible. The class vocabulary is genuine Tailwind v4 (same generated names), but several rewrites and one stale allowlist make the same class behave differently — or silently die — on native. Findings below are all source-verified against NativeScript/NativeScript packages/core.
1. supportedProperties is stale — strips properties core now supports
The allowlist in src/removeUnsupported.js predates core's current CSS registry. These properties exist in core (cssName: registrations in packages/core/ui/styling/style-properties.ts + view modules) but are stripped:
| Property | Tailwind utilities killed | Core support |
|---|---|---|
gap, row-gap, column-gap |
gap-*, gap-x-*, gap-y-* |
FlexboxLayout gap/rowGap/columnGap (NS 9) |
max-width, max-height |
max-w-*, max-h-* |
maxWidth/maxHeight cssName |
white-space |
whitespace-nowrap, whitespace-pre, … |
whiteSpace cssName |
text-overflow |
text-ellipsis, text-clip, truncate |
textOverflow cssName (truncate still needs overflow:hidden, which core genuinely lacks — partial parity only) |
perspective |
perspective-* |
perspective cssName |
direction |
dir/rtl related |
direction cssName |
Also note the plugin runs on all app CSS, not just Tailwind output — so a hand-written .foo { gap: 16px } in app.css is silently stripped too, even though FlexboxLayout honors it.
2. visibility: hidden → collapse rewrite is no longer correct
Core accepts hidden (core-types/index.ts Visibility.isValid = visible | hidden | collapse; style-properties.ts visibilityProperty only sets isCollapsed for collapse). So:
- Web
invisible= hidden, keeps layout space. - Native after rewrite =
collapse, removed from layout.
Same class, different layout. The rewrite should simply pass hidden through (keep collapse/collapsed as-is).
3. @media rules are deleted wholesale — breakpoints and system dark mode could work
mediaAtRule.remove() drops every @media block: sm:–2xl: variants, media-flavor dark:, portrait:/landscape: — all dead.
But core 8.8+ ships a media query engine (packages/core/css-mediaquery/index.ts): width, height, device-width/height, orientation, prefers-color-scheme, min-/max- modifiers, not, comma lists — plus matchMedia()/MediaQueryList with change events.
The catch: the parser only accepts colon syntax (min-width: 40rem); Tailwind v4 emits range syntax (width >= 40rem), which fails RE_MQ_EXPRESSION and throws SyntaxError — presumably why the wholesale drop exists. A PostCSS rewrite from range → min-/max- colon form (plus still dropping @media blocks using features core can't evaluate: hover, prefers-reduced-motion, resolution, …) would restore the entire breakpoint family and prefers-color-scheme dark mode instead of losing it all.
4. Transform utilities die on an artificial boundary
rotate-*survives (rotateis allowlisted, core supportsrotate).translate-x-*/translate-y-*/scale-*die: v4 emitstranslate:/scale:shorthand properties, and core exposestranslateX/translateY/scaleX/scaleY+transform. A rewrite —translate: x y→transform: translate(x, y),scale: n→transform: scale(n)— would restore these families without touching core.
5. Selector/cascade drift (smaller, mostly documentable)
:where()is unwrapped → loses zero-specificity, sodark:/variant rules gain real specificity on native vs web.@layerflattened → utilities become unlayered on native, so utility-vs-author-CSS precedence differs between platforms. (Unavoidable until core implements cascade layers; worth documenting.)@supportsflattened → applied unconditionally. Mostly fine (core 8.9.1+ supportscolor-mix), but any future@supportsguard for genuinely unsupported features will misfire.@propertyremoved →--tw-*vars loseinitial-value/inherits: false; chains likeshadow-*vars inherit differently than web. Mostly dead weight anyway since shadows don't map, but worth noting.space-*/divide-*rewritten to* + *— loses the> :not([hidden]) ~ :not([hidden])semantics, and the-reversevariants are broken (the--tw-space/divide-*-reversedeclarations get stripped).emtreated identically torem(×16) — wrong for nested-em contexts.vertical-align: middle → centeris redundant — core'sverticalAlignvalidator already acceptsmiddle(it's even in the plugin's own allowlist for that property).currentColordeclarations dropped →text-current,border-currentdead. Could rewrite toinherit-equivalent handling or a follow-up core feature.w-screen(100vw),hover:,focus-within:,&selectors — genuinely unsupported by core; dead by necessity, just worth documenting.
Suggested order of attack
- Refresh
supportedPropertiesfrom core'scssNameregistry (biggest win:gapalone unlocks the wholegap-*family) — and consider only running the strip on Tailwind-generated layers rather than all author CSS. - Range→colon
@mediarewrite + feature allowlist. - Drop the
hidden→collapserewrite. translate/scale→transformrewrites.- Document the rest as known divergences.
Happy to send a PR for 1–3 if you'd like — we have the core property registry mapped already.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 161
- Forks
- 29
- Ø Merge
- 1 Std. 39 Min.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus NativeScript/tailwind
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
NativeScript/tailwind#211 · 1 Kommentar · 2 Reaktionen ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
NativeScript/tailwind#200 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 55/100
NativeScript/tailwind#197 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 25/100
NativeScript/tailwind#193 · 3 Kommentare ·
-
enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
NativeScript/tailwind#188 · 4 Kommentare ·
Alle Issues in NativeScript/tailwind
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 1 Tag
-
curriculum documentation quality
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
githubnext/gh-aw-workshop#3897 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
agent/quality hive/hosted-available-lke648397-260827-5n31 quality testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 91/100
Maintainer antworten meist innerhalb von 1 Tag