diff --git a/docs/docs/getting-started.mdx b/docs/docs/getting-started.mdx index bf5c814d1..4ca64e3e4 100644 --- a/docs/docs/getting-started.mdx +++ b/docs/docs/getting-started.mdx @@ -98,4 +98,20 @@ import { Tooltip } from 'react-tooltip' ### Styling -If you want a styled tooltip, don't forget to add the style file `import 'react-tooltip/dist/react-tooltip.css` +If you want a styled tooltip, don't forget to add the style file `import 'react-tooltip/dist/react-tooltip.css`. + +Basic styling can be done by overriding the following css variables. + +```css +:root { + --rt-color-white: #fff; + --rt-color-dark: #222; + --rt-color-success: #8dc572; + --rt-color-error: #be6464; + --rt-color-warning: #f0ad4e; + --rt-color-info: #337ab7; + --rt-opacity: 0.9; +} +``` + +For advanced styling, check [the examples](./examples/styling.mdx). diff --git a/src/components/Tooltip/styles.module.css b/src/components/Tooltip/styles.module.css index 559e6ebbc..dcb47d545 100644 --- a/src/components/Tooltip/styles.module.css +++ b/src/components/Tooltip/styles.module.css @@ -31,7 +31,7 @@ .show { visibility: visible; - opacity: 0.9; + opacity: var(--rt-opacity); } /** Types variant **/ diff --git a/src/tokens.css b/src/tokens.css index f43d60182..6d14ee11a 100644 --- a/src/tokens.css +++ b/src/tokens.css @@ -5,4 +5,5 @@ --rt-color-error: #be6464; --rt-color-warning: #f0ad4e; --rt-color-info: #337ab7; + --rt-opacity: 0.9; }