Skip to content

Uniwind.updateCSSVariables does not update ScopedTheme components or resolve non-global web theme overrides reliably #499

@sascha-kaleidoscode

Description

@sascha-kaleidoscode

What happened?

Uniwind.updateCSSVariables(theme, variables) does not reliably trigger UI updates for components rendered under when the updated theme differs from the globally active theme.

On web, runtime variable overrides for non-global themes are also not consistently observable via getWebVariable / useCSSVariable, because resolution depends on document.documentElement and computed styles without consulting per-theme runtime state.

Steps to Reproduce

<ScopedTheme theme="premium">
    <View className="bg-background size-20" />
</ScopedTheme>
<Button
    title="Update"
    onPress={() =>
        Uniwind.updateCSSVariables('premium', {
            '--color-background': '#ff0000',
        })
    }
/>

Snack or Repository Link

https://github.com/sascha-kaleidoscode/uniwind-scoped-theme-update-bug-repo

Uniwind version

1.6.2

React Native Version

0.81.5

Platforms

Android, iOS, Web

Expo

Yes

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions