-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline Styles #203
Comments
From my experience, GSS listens for DOM changes and recalculates the layout when elements are added or removed. So when a React changes the DOM after an update, GSS would notice the change and recalculate the layout. GSS does apply inline styles to each element in the layout. It uses absolute positioning. Specifically, it sets the top, left, width and height properties. And yes, it does rerun whenever the window is resized. It should be pretty easy to throw together a little demo on Codepen to see how they work together - and you can use Dev Tools to see what's going on in the DOM. By the way, I'm not a contributor to this project, so if anyone who knows better wants to chime in, be my guest. |
I see. Thanks for the reply. My goal is more along the lines of compiling the GSS styles in the react render function so I can perform animations by adjusting the constraints and applying the inline styles myself...
|
"Suggested variables" are the best solution if you want to change a number within a constraint. So, if you wanted to change
You can pass GSS the value for You can change the variable value later by calling
Would that be appropriate for what you're trying to achieve? |
Not quite, I was hoping to get a JSON object back describing the inline styles for that element. That way, I could use something like react-tween-state to animate to that value. |
How hard would it be to translate GSS on the fly and translate them into inline styles for use with React?
Does GSS absolutely position everything and rerun anytime the window is resized?
The text was updated successfully, but these errors were encountered: