diff --git a/docs/docs/examples/styling.mdx b/docs/docs/examples/styling.mdx index 0d3e5a2b..81c79598 100644 --- a/docs/docs/examples/styling.mdx +++ b/docs/docs/examples/styling.mdx @@ -348,13 +348,15 @@ import { Tooltip } from 'react-tooltip' ### Changing the padding +The default `padding: 8px 16px` is on `.react-tooltip-content-wrapper`. `className` is applied to the tooltip root, so a `padding` rule there is added around the content instead of replacing the default. Set padding on the content wrapper. + #### Removing padding ```jsx import { Tooltip } from 'react-tooltip' @@ -383,7 +385,7 @@ import { Tooltip } from 'react-tooltip' import { Tooltip } from 'react-tooltip' diff --git a/docs/docs/upgrade-guide/changelog-v5-v6.md b/docs/docs/upgrade-guide/changelog-v5-v6.md index 7d4cd92c..78f99e17 100644 --- a/docs/docs/upgrade-guide/changelog-v5-v6.md +++ b/docs/docs/upgrade-guide/changelog-v5-v6.md @@ -21,6 +21,13 @@ V6 keeps the core tooltip behavior from V5, but updates the implementation and A - `data-tooltip-html` was removed - `html` prop was removed - Raw HTML string examples should now be implemented with `children` or `render` +- Default padding (`8px 16px`) is on `.react-tooltip-content-wrapper`, not the root `.react-tooltip`. This also shipped in 5.30.1. A `padding` rule on `className` is added around the content instead of replacing the default. Set it on the content wrapper: + +```css +.my-tooltip .react-tooltip-content-wrapper { + padding: 0; +} +``` ## New And Updated Capabilities diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css index 5db67ee6..90a1a67a 100644 --- a/docs/src/css/custom.css +++ b/docs/src/css/custom.css @@ -86,11 +86,11 @@ border-radius: 50%; } -.example-container .example-no-padding { +.example-container .example-no-padding .react-tooltip-content-wrapper { padding: 0; } -.example-container .example-padding { +.example-container .example-padding .react-tooltip-content-wrapper { padding: 48px; } diff --git a/docs/versioned_docs/version-5.x/examples/styling.mdx b/docs/versioned_docs/version-5.x/examples/styling.mdx index 12c70033..3b71fb67 100644 --- a/docs/versioned_docs/version-5.x/examples/styling.mdx +++ b/docs/versioned_docs/version-5.x/examples/styling.mdx @@ -348,13 +348,15 @@ import { Tooltip } from 'react-tooltip' ### Changing the padding +The default `padding: 8px 16px` is on `.react-tooltip-content-wrapper`. `className` is applied to the tooltip root, so a `padding` rule there is added around the content instead of replacing the default. Set padding on the content wrapper. + #### Removing padding ```jsx import { Tooltip } from 'react-tooltip' @@ -383,7 +385,7 @@ import { Tooltip } from 'react-tooltip' import { Tooltip } from 'react-tooltip'