How to use the @chakra-ui/theme.addOpacity function in @chakra-ui/theme

To help you get started, we’ve selected a few @chakra-ui/theme examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chakra-ui / chakra-ui / packages / chakra-ui / src / Badge / styles.ts View on Github external
const outlineStyle = ({ theme: { colors }, color }: PropsWithTheme) => {
  const _color = colors[color] && colors[color][200];
  const darkModeColor = addOpacity(_color, 0.8);
  const boxShadowColor = colors[color] && colors[color][500];
  return {
    light: {
      boxShadow: `inset 0 0 0px 1px ` + boxShadowColor,
      color: get(color, "500"),
    },
    dark: {
      boxShadow: `inset 0 0 0px 1px ` + darkModeColor,
      color: darkModeColor,
    },
  };
};
github chakra-ui / chakra-ui / packages / chakra-ui / src / Button / styles.tsx View on Github external
result = {
      light: {
        color: `${color}.500`,
        bg: "transparent",
        _hover: {
          bg: `${color}.50`,
        },
        _active: {
          bg: `${color}.100`,
        },
      },
      dark: {
        color: `${color}.200`,
        bg: "transparent",
        _hover: {
          bg: addOpacity(_color, 0.12),
        },
        _active: {
          bg: addOpacity(_color, 0.24),
        },
      },
    };
  }

  return result[colorMode];
};
github chakra-ui / chakra-ui / packages / chakra-ui / src / Button / styles.tsx View on Github external
bg: "transparent",
        _hover: {
          bg: `${color}.50`,
        },
        _active: {
          bg: `${color}.100`,
        },
      },
      dark: {
        color: `${color}.200`,
        bg: "transparent",
        _hover: {
          bg: addOpacity(_color, 0.12),
        },
        _active: {
          bg: addOpacity(_color, 0.24),
        },
      },
    };
  }

  return result[colorMode];
};
github chakra-ui / chakra-ui / packages / chakra-ui / src / Badge / styles.ts View on Github external
const solidStyle = ({ theme: { colors }, color }: PropsWithTheme) => {
  const _color = colors[color] && colors[color][500];
  const darkModeBg = addOpacity(_color, 0.6);
  return {
    light: {
      bg: get(color, "500"),
      color: "white",
    },
    dark: {
      bg: darkModeBg,
      color: "whiteAlpha.800",
    },
  };
};