-
Notifications
You must be signed in to change notification settings - Fork 1
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
ReactCSSDOM #15
Comments
Difference between ReactDOM & ReactCSSDOM
Compatibility
Implementation details
|
Question: how to generate For inspiration: |
@stereobooster This is a good question indeed and I am not completely sure yet. I have been thinking about using native „pseudo elements“, though: const spin = React.createRef()
const Spinner = () => (
<div css={{ animationName: spin, animationDuration: 2s }} />
)
ReactCSSDOM.render(
<>
<keyframes
ref={spin}
steps={{
'0%': {
transform: 'rotate(0deg)'
},
'100%': {
transform: 'rotate(360deg)'
}
}}
/>
<Spinner />
</>
) The example uses React 16.3‘s new |
nice! styled-jsx manages styles in a similar way https://github.com/zeit/styled-jsx/blob/master/src/stylesheet-registry.js |
@stereobooster I think this works better for at-rules: const Spinner = () => (
<keyframes
steps={{
'0%': {
transform: 'rotate(0deg)'
},
'100%': {
transform: 'rotate(360deg)'
}
}}
>{spin => (
<div css={{ animationName: spin, animationDuration: 2s }} />
)}</keyframes>
) It uses the |
Extend
react-dom
to provide a generic, fully featured, declarative styling API that is as easy to use as inline styles, but comes with the power of CSS classes:To render your app:
Server-side rendering should also be really simple. Something like that:
Benefits
The text was updated successfully, but these errors were encountered: