Commit 91ba054c authored by tom's avatar tom

fix tooltip colors

parent 60219d5f
import { Tooltip as TooltipComponent } from '@chakra-ui/react';
import { defineStyle, defineStyleConfig } from '@chakra-ui/styled-system';
import { mode } from '@chakra-ui/theme-tools';
import { mode, cssVar } from '@chakra-ui/theme-tools';
const $bg = cssVar('tooltip-bg');
const $fg = cssVar('tooltip-fg');
const $arrowBg = cssVar('popper-arrow-bg');
const variantNav = defineStyle((props) => {
return {
......@@ -21,8 +25,18 @@ const variants = {
nav: variantNav,
};
const baseStyle = defineStyle({
const baseStyle = defineStyle((props) => {
const bg = mode('gray.700', 'gray.200')(props);
const fg = mode('white', 'black')(props);
return {
bg: $bg.reference,
color: mode('white', 'black')(props),
[$bg.variable]: `colors.${ bg }`,
[$fg.reference]: `colors.${ fg }`,
[$arrowBg.variable]: $bg.reference,
maxWidth: 'unset',
};
});
const Tooltip = defineStyleConfig({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment