Skip to content

Commit

Permalink
Cleans up styles
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviawongnyc committed Dec 3, 2024
1 parent f911d19 commit e29688c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/components/Template/TemplateNew.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Box, useStyleConfig } from "@chakra-ui/react";

const TemplateNew: React.FC<any> = ({ children, sidebar = "none" }) => {
console.log("side -->", sidebar);
const styles = useStyleConfig("TemplateNew", { variant: sidebar });

return <Box __css={styles}>{children}</Box>;
Expand All @@ -20,7 +19,7 @@ const TemplateNewTop: React.FC<any> = ({ children }) => {
};

const TemplateNewMain: React.FC<any> = ({ children }) => {
const styles = useStyleConfig("TemplateNewMain", {});
const styles = useStyleConfig("TemplateNewMain");

return <Box __css={styles}>{children}</Box>;
};
Expand Down
32 changes: 21 additions & 11 deletions src/theme/components/templatenew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@ const TemplateNew = defineStyleConfig({
baseStyle: defineStyle({
boxSizing: "border-box",
color: "ui.typography.body",
maxWidth: "min(100vw, 1280px)",
m: "0 auto",
display: "grid",
maxWidth: "1280px",
m: "0 auto",
p: "s",
gap: responsiveGap,
gridTemplateAreas: `"breakout" "top" "main" "bottom"`,
gridTemplateColumns: "repeat(1, minmax(100px, 1fr))",
gridTemplateRows: "auto",
gridTemplateAreas: `"breakout" "top" "main" "bottom"`,
}),
variants: {
left: {
gridTemplateAreas: {
base: `"breakout" "top" "sidebar" "main" "bottom"`,
md: `"breakout breakout" "top top" "sidebar main" "bottom bottom"`,
},
gridTemplateColumns: {
base: "repeat(1, minmax(100px, 1fr))",
md: "repeat(2, minmax(100px, 1fr))",
lg: "minmax(100px, 1fr) minmax(200px, 2fr)",
xl: "minmax(100px, 1fr) minmax(300px, 3fr)",
},
gridTemplateAreas: {
base: `"breakout" "top" "sidebar" "main" "bottom"`,
md: `"breakout breakout" "top top" "sidebar main" "bottom bottom"`,
},
},
right: {
gridTemplateAreas: {
base: `"breakout" "top" "main" "sidebar" "bottom"`,
md: `"breakout breakout" "top top" "main sidebar" "bottom bottom"`,
},
gridTemplateColumns: {
base: "repeat(1, minmax(100px, 1fr))",
md: "repeat(2, minmax(100px, 1fr))",
lg: "minmax(200px, 2fr) minmax(100px, 1fr)",
xl: "minmax(300px, 3fr) minmax(100px, 1fr)",
},
gridTemplateAreas: {
base: `"breakout" "top" "main" "sidebar" "bottom"`,
md: `"breakout breakout" "top top" "main sidebar" "bottom bottom"`,
},
},
},
});
Expand All @@ -64,6 +64,16 @@ const TemplateNewMain = defineStyleConfig({
baseStyle: defineStyle({
gridArea: "main",
}),
variants: {
featuredContent: {
width: "100vw",
ml: "calc(-50vw + 50%)",
px: "s",
},
text: {
maxWidth: "600px",
},
},
});

const TemplateNewSidebar = defineStyleConfig({
Expand Down

0 comments on commit e29688c

Please sign in to comment.