Replies: 6 comments 5 replies
-
|
Hey! 👋 Thanks so much for the kind words and for considering Uniwind for gluestack-ui. That's really exciting to hear! 🎉 Really appreciate you taking the time to share this feedback about We're actively looking into the best way to implement this. The thing is, we want to avoid wrapping everything in context like NativeWind did because that hits performance pretty hard, and keeping the core fast is super important to us. We're exploring other approaches that won't slow things down. Timeline wise, we're planning to tackle this in Q1. Right now our main focus is getting the pro version ready, but this is high on the list after that. We want to make sure we implement Let us know if you have any other questions or suggestions in the meantime! |
Beta Was this translation helpful? Give feedback.
-
|
Hi @jpudysz , Great to hear that |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Sanchitv3 |
Beta Was this translation helpful? Give feedback.
-
|
NativeWind actually already solves this problem on native platforms at runtime, so I wanted to share how that works in case it’s useful context for Uniwind. On iOS / Android there’s no DOM, so NativeWind doesn’t rely on real For example: <Pressable
dataSet={{ disabled: 'true', active: 'true' }}
className="data-[disabled=true]:opacity-50 data-[active=true]:scale-95"
/>Under the hood, NativeWind:
That’s why In contrast, Uniwind’s current Right now, to bridge this on web, we expand Hope this helps explain the difference in behavior
|
Beta Was this translation helpful? Give feedback.
-
|
Example creator code with nativewind: dataSet={{
hover: isHoveredProp || isHovered ? 'true' : 'false',
focus: isFocusedProp || isFocused ? 'true' : 'false',
active: isPressedProp || isPressed ? 'true' : 'false',
disabled: isDisabled ? 'true' : 'false',
focusVisible:
isFocusVisibleProp || isFocusVisible ? 'true' : 'false',
}}Example creator code with uniwind: data-hover={isHoveredProp || isHovered ? 'true' : 'false'}
data-focus={isFocusedProp || isFocused ? 'true' : 'false'}
data-active={isPressedProp || isPressed ? 'true' : 'false'}
data-disabled={isDisabled ? 'true' : 'false'}
data-focus-visible={isFocusVisibleProp || isFocusVisible ? 'true' : 'false'}Example creator code if we want to support both: // for nativewind data attributes
dataSet={{
hover: isHoveredProp || isHovered ? 'true' : 'false',
focus: isFocusedProp || isFocused ? 'true' : 'false',
active: isPressedProp || isPressed ? 'true' : 'false',
disabled: isDisabled ? 'true' : 'false',
focusVisible:
isFocusVisibleProp || isFocusVisible ? 'true' : 'false',
}}
// for uniwind data attributes
data-hover={isHoveredProp || isHovered ? 'true' : 'false'}
data-focus={isFocusedProp || isFocused ? 'true' : 'false'}
data-active={isPressedProp || isPressed ? 'true' : 'false'}
data-disabled={isDisabled ? 'true' : 'false'}
data-focus-visible={isFocusVisibleProp || isFocusVisible ? 'true' : 'false'} |
Beta Was this translation helpful? Give feedback.
-
|
Since RNW doesn't support data-* and instead it uses dataSet to inject data attributes into html elements we've resolved it in this PR - #443 We don't want to support dataSet directly because as far as I know it's not typed by default in react native |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Uniwind team 👋
First of all, great work on Uniwind — we’re actively evaluating it and are very close to integrating Uniwind into gluestack-ui as our styling solution.
While testing, we noticed a gap in support for
data-*attributes on React Native, which currently works well in NativeWind but does not seem to work in Uniwind (native).Problem Statement
In NativeWind, we rely heavily on data-* attributes to drive state-based styling, especially for:
Feature Request
Add support for
data-*attributes on React Native, similar to NativeWind, so that the following work consistently:Context
We are almost done integrating Uniwind into gluestack-ui
This feature is one of the final blockers for full adoption
Happy to test, validate, or help with implementation feedback if needed
Thanks 🙏
Thanks again for building Uniwind — it’s shaping up really well.
Looking forward to your thoughts on this and whether it’s something that can be supported.
Let us know how we can help 🚀
Beta Was this translation helpful? Give feedback.
All reactions