Skip to content

Instantly share code, notes, and snippets.

@tomchentw
Last active July 7, 2021 16:11
Show Gist options
  • Save tomchentw/989ad340001061726bf2c0734d3739cf to your computer and use it in GitHub Desktop.
Save tomchentw/989ad340001061726bf2c0734d3739cf to your computer and use it in GitHub Desktop.
Customized @chakra-ui/react theme. https://chakra-ui.com/docs/theming/customize-theme
module.exports = {
components: {
Button: {
// 1. We can update the base styles
baseStyle: {
fontWeight: "bold", // Normally, it is "semibold"
},
// 2. We can add a new button size or extend existing
sizes: {
xs: {
h: "80px",
minW: "80px",
fontSize: "6xl",
},
xl: {
h: "56px",
fontSize: "lg",
px: "32px",
},
},
// 3. We can add a new visual variant
variants: {
"with-shadow": {
bg: "red.400",
boxShadow: "0 0 2px 2px #efdfde",
},
// 4. We can override existing variants
solid: (props) => ({
bg: props.colorMode === "dark" ? "red.300" : "red.500",
}),
},
},
},
}
@tomchentw
Copy link
Author

tomchentw commented Jun 27, 2021

module.exports = {
  components: {
    Button: {
      sizes: {
        md: {
          fontSize: "xl",
          p: "32px",
        },
      },
    },
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment