Last active
July 7, 2021 16:11
-
-
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
This file contains hidden or 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
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", | |
}), | |
}, | |
}, | |
}, | |
} |
Author
tomchentw
commented
Jun 27, 2021
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment