Skip to content

Native parser: :root state leaks into sibling classes in layers/supports #709

Description

@eliotgevers

What happened?

:root leaks parser state into sibling classes inside @layer or @supports, so class declarations become variables instead of styles.

@layer utilities {
  :root { --root-width: 10px; }
  .after-root { width: 42px; }
}

Expected: class width 42. Actual: empty class style; vars.width is 42.

Follow-up to #668, #671 and #686: the media fix shipped, but the :root reset described in #671 is still missing in 1.12.1 and current main.

Steps to Reproduce

Clone the branch below, then run:

bun install --frozen-lockfile
cd packages/uniwind
bun run test:native --runInBand root-state

Four cases fail; the top-level control passes.

Snack or Repository Link

https://github.com/eliotgevers/uniwind/tree/repro/root-state-leak

Uniwind version

1.12.1 / main (5c233bf)

React Native Version

0.86.3 (repository test harness)

Platforms

Native CSS parser; reproduced with iOS configuration.

Expo

Yes

Additional information 〰

  • Searched for similar open issues; this follows the closed discussion above.

Activity

  1. added
    bugSomething isn't working
    pending-releaseFixed, waiting for new version to be released
    and removed on Oct 5, 2026
  2. Brentlok commented on Oct 5, 2026

    @Brentlok
    Contributor

    🚀 This pull request is included in v1.12.2. See Release v1.12.2 for release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpending-releaseFixed, waiting for new version to be releaseduniwind-oss

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions