-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbb6bcc
commit a1b3686
Showing
3 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { | ||
ComponentSingleStyleConfig, | ||
Tooltip as ChakraTooltip, | ||
cssVar, | ||
} from "@chakra-ui/react" | ||
|
||
// Currently, there is no possibility to set all tooltips with hasArrow by defaultProps. | ||
// Let's override the defaultProps as follows. | ||
ChakraTooltip.defaultProps = { ...ChakraTooltip.defaultProps, hasArrow: true } | ||
|
||
// To make the arrow the same color as the background, the css variable needs to be set correctly. | ||
// More info: https://github.com/chakra-ui/chakra-ui/issues/4695#issuecomment-991023319 | ||
const $arrowBg = cssVar("popper-arrow-bg") | ||
|
||
const Tooltip: ComponentSingleStyleConfig = { | ||
baseStyle: { | ||
borderRadius: "md", | ||
bg: "grey.700", | ||
[$arrowBg.variable]: "colors.grey.700", | ||
}, | ||
} | ||
|
||
export default Tooltip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters