33 Commits

Author SHA1 Message Date
Julius Marminge 0c01f443b2 fix: read variant tokens from flattened class selectors (#662)
* fix: read variant tokens from flattened class selectors

Tailwind 4.3.3 stopped nesting variants under the utility class and emits
compound selectors instead:

  <= 4.3.2                           4.3.3
  .active\:x { &:active { ... } }    .active\:x:active { ... }

The native processor only read `:active`, `:focus`, `:disabled`, theme
`:where(...)`, `:dir()` and `[data-*]` tokens from nested rules. On the
flattened form the leading class token was accepted and the rest of the
selector ignored, so every variant compiled as an unconditional style:
`active:bg-red-500` was red at rest, `disabled:opacity-50` always dim,
`dark:` always on.

Read variant tokens from the components that follow the class token too,
sharing one reader with the nested path. A flattened compound the runtime
cannot observe (`disabled:` also emits `[aria-disabled="true"]`) is
dropped, matching what its empty nested rule compiled to before.

Regression test feeds both selector shapes straight to ProcessorBuilder,
so it does not depend on which Tailwind the repo pins. With
`@tailwindcss/node` at 4.3.3 the existing suite goes from 11 failures
(pressable, touchables, data-attributes, dir) to green.

* chore: bump tailwind dependencies to 4.3.3

Root catalog, @tailwindcss/node and @tailwindcss/oxide in the package, and
@tailwindcss/vite in the vite example. The repo now runs its own suite
against the flattened variant selectors that 4.3.3 emits.

* fix: handle flattened theme roots on web and skip unobservable compounds

Two follow-ups from review and CI on Tailwind 4.3.3.

Web: Tailwind now flattens `:root { &:where(.dark, .dark *) {} }` into a
sibling `:root:where(.dark, .dark *) {}` rule. The rule visitor only
rewrote nested theme variants into `.dark`, so the flattened form kept its
`:root` prefix and a scoped `.dark` class could not select it; the
`bg-background in dark theme` e2e test failed. Route a theme-layer `:root`
rule whose second token is `:where(.theme)` through the same rewrite.

Native: a selector mixing a supported variant with a token the runtime
cannot observe (`disabled:active:` emits `[aria-disabled="true"]:active`)
used to keep the branch gated on `:active` alone. Track unsupported tokens
in `readSelectorVariants` and skip the whole selector instead of applying
it under a weaker condition.
2026-09-04 07:58:05 +02:00
Hubert Bieszczad 7e4fb7d065 test: migrate web tests to vitest (#647) 2026-08-26 08:12:49 +02:00
Hubert Bieszczad 6b498f2ada chore: update to expo 57 (#591)
* chore: update to expo 57

* chore: bump tailwind
2026-07-02 09:08:41 +02:00
Hubert Bieszczad 1cad2cbc43 feat: vite 8 support (#560)
* chore: remove esbuild in e2e test setup

* chore: remove nulls in style ast

* feat: vite 8 support
2026-06-01 11:00:33 +02:00
Hubert Bieszczad 6b6d1ef6b4 chore: update dependencies (#549)
* chore: update dependencies

* chore: delete RN patch
2026-05-25 10:36:33 +02:00
Hubert Bieszczad bf79ad8ed9 chore: use oxlint instead of eslint (#503)
* chore: use oxlint instead of eslint

* style: oxlint-disable comments
2026-04-21 12:08:44 +02:00
Hubert Bieszczad 01a6b5e8d4 fix: pass data attributes to withUniwind (#477)
* fix: pass data attributes to withUniwind

* chore: use data attributes on dummy for getting web styles

* chore: change dataSet keys to camel case
2026-03-26 09:11:35 +01:00
Hubert Bieszczad 70d8a86e0d chore: validate each entry in serialization instead of whole object (#456) 2026-03-16 14:54:54 +01:00
Hubert Bieszczad 34693ea9b8 fix: parsing multiple transforms tokens in single class (#451)
* fix: parsing multiple transforms tokens in single class

* chore: defensive null check

* chore: turbo update
2026-03-12 14:23:00 +01:00
Hubert Bieszczad 86f7a786bf test: setup playwright tests (#437)
* test: setup playwright tests

* chore: install Playwright browsers in CI

* chore: add esbuild as a dev dependency

* chore: bump turbo
2026-03-05 15:14:09 +01:00
Hubert Bieszczad 131da4cca5 chore: update deps, update expo to 55 (#436)
* chore: update some deps

* feat: update expo to 55 and remove expo-router app
2026-03-05 12:48:12 +01:00
Hubert Bieszczad 65d037b9e5 fix: move theme selector out of the root, and remove nulls (#420)
* fix: move theme selector out of the root

* chore: update turbo

* chore: remove all nulls in layers
2026-03-02 11:07:52 +01:00
Hubert Bieszczad 633a67d392 fix: withUniwind merge with inline (#378)
* fix: withUniwind merge with inline

* test: setup web tests

* test: more cases for withUniwind-native

* test: basic withUniwind test for web

* test: withUniwind web complete tests

* chore: minor changes
2026-02-12 09:52:30 +01:00
Hubert Bieszczad 608f5a17f7 feat: support data attributes (#339)
* feat: data attributes

* chore: simplify useStyle

* chore: minor correction

* chore: update turbo

* chore: update eslint config
2026-01-28 12:09:54 +01:00
Hubert Bieszczad 1e74eb8295 test: jest tests for parsing styles and native components (#230)
* test: setup jest tests with @testing-library/react-native

* chore: update turbo

* chore: add @types/jest

* test: spacing tests

* test: shadow tests

* test: gradient tests

* test: gradient

* test: layout

* test: spacing

* test: borders

* test: typography

* test: transforms

* test: move styles parsing tests to directory

* test: view and button

* test: activity-indicator

* test: flat-list

* test: image

* test: image-background

* test: input-accessory-view

* test: keyboard-avoiding-view

* test: modal

* test: pressable

* test: refresh-control

* test: safe-area-view

* test: scroll-view

* test: section-list

* test: switch

* test: Text

* test: TextInput

* test: touchable-highlight

* test: touchables

* test: touchabe without feedback

* test: virtualized list

* test: pressable active
2025-12-12 14:35:54 +01:00
Burak Emre Görmek dcdf730f09 feat(web): add Vite support (#182)
* feat(web): add vite support

* chore: format

* fix: add missing css functions

* chore: remove postcss

* chore: make export default

* fix: make sure the plugin work under the workspace

* fix: exclude react-native in optimizeDeps to resolve correctly

* chore: add vite example

* chore: import uniwind in app.css

* chore: update dependencies

* chore: vite example add min height

* chore: simplify dirname for esm

* fix: support custom-variants

* chore: normalizePath for potential windows issue

* fix: prevent listeners from resetting in dev build

* fix: reinit themes

* chore: minor corrections

---------

Co-authored-by: Hubert Bieszczad <brentlokk@gmail.com>
2025-12-05 12:01:49 +01:00
Hubert Bieszczad 1adda32ab8 chore: run dprint check on precommit 2025-12-02 07:40:27 +01:00
Hubert Bieszczad e1ae80c149 chore: update dependencies and bun (#167)
* chore: bun 1.3

* chore: update deps
2025-11-18 08:19:15 +01:00
Hubert Bieszczad 2e857894e9 chore: update dependencies, and use catalog's (#125)
* chore: update deps in expo-example and bare

* chore: partially update expo-router

* chore: update mmkv in expo-router example

* chore: update some minor deps

* chore: format
2025-11-03 07:57:27 +01:00
Hubert Bieszczad 574dd539bb chore: add postinstall script to exclude uniwind.css from git locally 2025-10-27 08:16:37 +01:00
Jacek Pudysz 8a1639f99c Revert "chore: change packge.json visibility" 2025-10-16 09:36:15 +02:00
Jacek Pudysz 225b367101 chore: change packge.json visibility 2025-10-16 08:58:10 +02:00
Hubert Bieszczad b264c892f9 chore: add missing circular check 2025-10-07 07:50:31 +02:00
Hubert Bieszczad c18cacdaf3 chore: update dependencies 2025-10-04 13:50:13 +02:00
Jacek Pudysz 4726d62c4a feat: add useUniwind support 2025-09-28 06:44:51 +02:00
Hubert Bieszczad c84ecc2dd9 feat: unit tests (#16)
* feat: colors unit tests

* chore: separate test task in turbo

* feat: convert currentColor

* test: spacing tests

* test: shadow tests
2025-09-08 10:29:55 +02:00
Hubert Bieszczad 25bda5f5e0 feat: update to expo 54 and create bare RN example (#8)
* feat: update to expo 54 and create bare RN example

* chore: update expo-example

* chore: update package.json
2025-08-19 09:44:06 +02:00
Hubert Bieszczad f70c4ee5a6 feat: dont parse web to rn stylesheets 2025-08-01 15:08:26 +02:00
Hubert Bieszczad 4568630b6c feat: expo example 2025-07-29 12:18:40 +02:00
Hubert Bieszczad 24ea2badc1 feat: monorepo 2025-07-29 10:10:05 +02:00
Hubert Bieszczad 7bedc388ed fix: exporting 2025-07-29 09:27:38 +02:00
Hubert Bieszczad 2c31dfd091 feat: uniwind.css 2025-07-29 08:21:42 +02:00
Hubert Bieszczad b902c96128 feat: initial commit 🍃 2025-07-28 15:11:44 +02:00