-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Style using styled components #221
Comments
it may not be easy to do this since content is detached to document.body. use plain css instead |
we created our own layer through the
|
You can change the arrow and whatever you like by using the function getTooltipContainer. By default it returns the body element but you can make your own wrapper element (styled component) and use that. //styled component - wrapper element
//ref
//getTooltipContainer built-in function
//Tooltip wrapped in your styled component
|
Or... you can override it in your Theme |
Another option is using Styled Components' global styles helper, and import { createGlobalStyle } from 'styled-components';
export const MyTooltipStyles = createGlobalStyle`
.rc-tooltip.rc-tooltip-zoom-appear,
.rc-tooltip.rc-tooltip-zoom-enter {
opacity: 0;
}
.rc-tooltip.rc-tooltip-zoom-enter,
.rc-tooltip.rc-tooltip-zoom-leave {
display: block;
}
...
`; Customize away! And then just render this component wherever you want these to brought in. Since tooltips are usually an app-wide component, render |
|
Hi,
Is it possible to style the tooltip using styled components?
When I wrap the components with styled(Tooltip)'
// all css here
'
It doesn't work.
I know I can use my own styled container and pass it to overlay, but I need a solution to style the arrow....
The text was updated successfully, but these errors were encountered: