We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Can u add something like 'css' prop in glamorous? I think it might be useful when u want specify just a margin.
<MyStyledComponent css={{ marginBottom: 8 }}/>
The text was updated successfully, but these errors were encountered:
Hi @kserjey!
That's a nice point, thanks.
But it looks like it may have the same problems as described here #41 (comment), because it causes the styles recalculation on each mount/rerender.
As a workaround, you can use style attribute for inline styles in such cases.
style
You can also pass the className with class, created by the jss, for example:
className
jss
// css.js const sheet = jss.createStyleSheet().attach(); const cache = new Map() export default styles => { if (cache.has(styles)) return cache.get(styles) const rule = sheet.addRule(styles) cache.set(styles, rule) return rule }
import css from './css' const {className} = css({marginBottom: 8}) <MyStyledComponent className={className} />
Maybe it will be valuable to make a function like this css as a helper in this library.
css
But I hope to find an effective implementation for the suggested behavior, and, of course, we're open for PRs :)
Sorry, something went wrong.
I am also thinknig to have such a function in the core JSS.
No branches or pull requests
Can u add something like 'css' prop in glamorous? I think it might be useful when u want specify just a margin.
The text was updated successfully, but these errors were encountered: