Skip to content

Commit 14798bd

Browse files
docs: deprecate removeStyle()/env variables
1 parent 7bdce01 commit 14798bd

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docs/docs/examples/styling.mdx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,3 +393,40 @@ Do not set `disableStyleInjection` dynamically. Changing its value requires a pa
393393
Check out more details about the [base](#base-styles) and [core](#core-styles) styles.
394394

395395
:::
396+
397+
#### Environment variables
398+
399+
:::danger
400+
401+
This has been deprecated. Use [`disableStyleInjection`](#disabling-reacttooltip-css) instead.
402+
403+
:::
404+
405+
You can prevent ReactTooltip from injecting styles into the page by using environment variables.
406+
407+
| name | type | required | default | values | description |
408+
| ----------------------------------- | --------- | -------- | ------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
409+
| `REACT_TOOLTIP_DISABLE_CORE_STYLES` | `boolean` | no | `false` | `true` `false` | Environment variable to disable **core** styles from being injected into the page by ReactTooltip.<br /><br /> We strongly recommend to keep the core styles being injected into the project unless you know what you are doing. |
410+
| `REACT_TOOLTIP_DISABLE_BASE_STYLES` | `boolean` | no | `false` | `true` `false` | Environment variable to disable **base** styles from being injected into the page by ReactTooltip.<br /><br /> Those styles are just visual styles like colors, padding, etc... And can be disabled if you want to write your tooltip styles. |
411+
412+
413+
#### `removeStyle()` function
414+
415+
:::danger
416+
417+
This has been deprecated. Use [`disableStyleInjection`](#disabling-reacttooltip-css) instead.
418+
419+
:::
420+
421+
You can also use the `removeStyle()` function to remove injected styles from the page. It accepts the following parameters:
422+
423+
| name | type | required | default | values | description |
424+
| ---- | ------ | -------- | ------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
425+
| type | string | no | `base` | `base` `core` | If `core` is defined, the core styles will be removed from the page, if nothing is defined, `base` styles will be removed as default value |
426+
427+
```jsx
428+
import { removeStyle } from 'react-tooltip'
429+
430+
removeStyle() // removes the injected base style of ReactTooltip
431+
removeStyle({ type: 'core' }) // removes the injected core style of ReactTooltip - this can affect the basic functionality of ReactTooltip
432+
```

0 commit comments

Comments
 (0)