Skip to content

Instantly share code, notes, and snippets.

@gaurangrshah
Created November 4, 2020 06:37
Show Gist options
  • Save gaurangrshah/ef1057175d6526ddc7c0f3efe5f1d76f to your computer and use it in GitHub Desktop.
Save gaurangrshah/ef1057175d6526ddc7c0f3efe5f1d76f to your computer and use it in GitHub Desktop.
#chakra-ui #components #config
const Button = {
baseStyle: {
default: {
border: "none",
variant: "solid",
colorScheme: "blue",
color: "white",
textAlign: "left",
pl: 2, // 0.5rem
_hover: {
textDecoration: "none",
border: "1px solid currentColor",
},
},
moreLink: {
mt: 4, // 1rem
ml: "20%",
p: 2, // 0.5rem
variant: "solid",
colorScheme: "teal",
rightIcon: "arrow-forward",
size: ["xs", null, "md"],
},
contactMobile: {
color: "inherit",
bg: "transparent",
border: "1px",
borderColor: "currentColor",
ml: "auto",
mt: 8,
size: ["2xs", null, null],
},
contactDesktop: {
color: "inherit",
bg: "transparent",
border: "1px",
borderColor: "currentColor",
textTransform: "capitalize",
mt: -1,
},
navLink: {
w: ["full", null, null, "auto"],
p: 3,
mt: [10, null, null, 0], // [2.5rem, null, null, 0]
mr: [null, null, null, 6], // [null, null, null, 1.5rem]
mb: 2,
color: "inherit",
rounded: "5px",
textTransform: "capitalize",
textAlign: ["right", null, null, "initial"],
borderBottom: ["1px solid rgba(255,255,255,0.1)", null, null, "0px"],
whiteSpace: "nowrap",
},
},
}
export default Button
const base = {
py: [6, null, null, 4],
px: [6, null, null, 1],
mx: "auto",
maxW: "7xl", // WRAPPER_MAX_WIDTH
justify: ["space-between"],
// align: ["stretch", null, null, "center"],
wrap: ["wrap", null, null, "nowrap"],
}
const header = {
baseStyle: {},
sizes: {},
variants: {
base: {
py: [3, null, null, 3],
px: [6, null, null, 3],
maxW: ["3xl", null, null, "7xl"], // WRAPPER_MAX_WIDTH
mx: "auto",
justifyContent: ["space-between"],
},
mobile: {
display: ["flex", null, null, "none"],
flexDirection: "column",
align: ["stretch"],
wrap: ["wrap"],
py: 10,
flex: 1,
fontSize: "lg",
overflow: "hidden",
},
desktop: {
display: ["none", null, null, "flex"],
flexDirection: "row",
justifyContent: "flex-end",
alignItems: [null, null, null, "center"],
wrap: ["wrap", null, null, "nowrap"],
px: 6,
flex: 1,
fontSize: [null, null, null, "md"],
overflow: "hidden",
},
},
defaultProps: {},
}
export default header
import { linearGradient } from "../../components/chakra-ui"
const hero = {
parts: ["base", "content", "block"],
baseStyle: {
base: {
h: ["30vh", null, null, "50vh"],
background: linearGradient(14),
},
content: {
position: "absolute",
top: 0,
right: 0,
left: 0,
mx: "auto",
mt: [12 * 4, "20%", null, 12 * 4],
maxW: ["5xl", null, null, null, "60%"],
},
block: {
position: "relative",
mx: 0,
},
},
sizes: {},
variants: {},
defaultProps: {},
}
export default hero
import Button from "./buttons"
import header from "./header"
import footer from "./footer"
import hero from "./hero"
export default {
header,
footer,
Button,
hero,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment