fixed color mode button background

This commit is contained in:
2026-09-09 11:54:24 -07:00
parent 4aa8eb7ff0
commit 4914b64fe2
5 changed files with 81 additions and 47 deletions
+1 -1
View File
@@ -24,6 +24,6 @@ export default defineConfig([globalIgnores(['dist']), {
}, },
}, },
rules: { rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], 'no-unused-vars': 'off',
}, },
}, ...storybook.configs["flat/recommended"]]) }, ...storybook.configs["flat/recommended"]])
+3
View File
@@ -2,6 +2,9 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="volcano.svg" /> <link rel="icon" type="image/svg+xml" href="volcano.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>VDAP</title> <title>VDAP</title>
+2 -1
View File
@@ -1,3 +1,4 @@
:root { :root {
font-family: Georgia, 'Times New Roman', Times, serif; /*font-family: Georgia, 'Times New Roman', Times, serif;*/
font-family: "Roboto", sans-serif;
} }
+12 -19
View File
@@ -1,4 +1,4 @@
import {HStack, Flex, Box, useRecipe} from "@chakra-ui/react"; import {HStack, Flex, Box, useRecipe, useSlotRecipe} from "@chakra-ui/react";
import {NavLink, Outlet, useLocation} from "react-router-dom"; import {NavLink, Outlet, useLocation} from "react-router-dom";
import {SearchBar} from "../../components/dashboard/SearchBar.jsx"; import {SearchBar} from "../../components/dashboard/SearchBar.jsx";
import {SettingsButton} from "../../components/dashboard/SettingsButton.jsx"; import {SettingsButton} from "../../components/dashboard/SettingsButton.jsx";
@@ -16,30 +16,23 @@ const HOME_TABS = [
]; ];
export default function Home() { export default function Home() {
const recipe = useRecipe({key: "glassTab"}); const glassTabsRecipe = useRecipe({key: "glassTab"});
const tabStyles = recipe(); const homeRecipe = useSlotRecipe({key: "home"});
const glassTabsStyle = glassTabsRecipe();
const homeStyle = homeRecipe();
const location = useLocation(); const location= useLocation();
const isPersonalDashboard = location.pathname === "/home" || location.pathname === "/home/"; const isPersonalDashboard= location.pathname === "/home" || location.pathname === "/home/";
return ( return (
<Flex direction="column" height="100%" width="100%"> <Flex css={homeStyle.root}>
<Flex as="header">
<Flex as="header" position="sticky" top="0" zIndex="dropdown" bg="transparent" p={5} align="center"
justify="space-between" width="100%">
{/* TABS CONTAINER */} {/* TABS CONTAINER */}
<Flex gap={2} alignItems="center"> <Flex>
{HOME_TABS.map((tab) => { {HOME_TABS.map((tab) => {
const Icon = tab.icon; const Icon = tab.icon;
return ( return (
<Box <Box key={tab.name} as={NavLink} to={tab.url} end={tab.exact} css={glassTabsStyle}> {/* CRITICAL: 'end' prop forces exact match so "/home" deactivates on sub-routes*/}
key={tab.name}
as={NavLink}
to={tab.url}
end={tab.exact} // CRITICAL: Forces exact match so "/home" deactivates on sub-routes
css={tabStyles}
>
{/* flexShrink: 0 ensures the icon never squishes during the gooey animation */} {/* flexShrink: 0 ensures the icon never squishes during the gooey animation */}
<Icon size={24} style={{flexShrink: 0}}/> <Icon size={24} style={{flexShrink: 0}}/>
<Box as="span">{tab.name}</Box> <Box as="span">{tab.name}</Box>
@@ -59,7 +52,7 @@ export default function Home() {
</Flex> </Flex>
{/* TABS CONTENT */} {/* TABS CONTENT */}
<Flex flex="1" overflow="auto"> <Flex>
<Outlet/> <Outlet/>
</Flex> </Flex>
+63 -26
View File
@@ -31,8 +31,8 @@ const headerRecipe = defineSlotRecipe({
// The Text component // The Text component
"& p": { "& p": {
fontWeight: "bold", fontWeight: "600",
fontSize:"16px" // equivalent to chakra 'md' fontSize: "16px" // equivalent to chakra 'md'
} }
} }
}, },
@@ -95,9 +95,9 @@ const sidebarRecipe = defineSlotRecipe({
}, },
_hover: { _hover: {
bg: "rgba(255, 255, 255, 0.1)", bg: "rgba(255, 255, 255, 0.2)",
color: "{text}", color: "{text}",
fontWeight: "semibold", fontWeight: "500",
"& svg": { "& svg": {
strokeWidth: "3" strokeWidth: "3"
} }
@@ -165,7 +165,7 @@ const sidebarRecipe = defineSlotRecipe({
px: 0, px: 0,
}, },
logo_text: { logo_text: {
transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease", transition: "opacity 0.2s ease, visibility 0.2s ease, margin 0.2s ease",
whiteSpace: "nowrap", whiteSpace: "nowrap",
overflow: "hidden", overflow: "hidden",
textOverflow: "clip", textOverflow: "clip",
@@ -181,50 +181,47 @@ const sidebarRecipe = defineSlotRecipe({
whiteSpace: "nowrap", whiteSpace: "nowrap",
overflow: "hidden", overflow: "hidden",
textOverflow: "clip", textOverflow: "clip",
fontWeight: "500"
}, },
collapse_button: { collapse_button: {
"& svg": { flexShrink: "0" }, "& svg": {flexShrink: "0"},
}, },
opened_theme_button: { opened_theme_button: {
width: "100%" , width: "100%",
align: "center", align: "center",
justifyContent: "right", justifyContent: "right",
mr: 6, mr: 6,
"& .chakra-button": { // targets the chakra button class in ColorModeButton component to set bg transparency
"&:hover": {
bg: "transparent",
}
},
"& button": { "& button": {
alignSelf: "center", alignSelf: "center",
transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease", transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease",
_hover: {
bg: "transparent",
}
} }
}, },
closed_theme_button: { closed_theme_button: {
ml: 0.9, ml: 0.9,
"& .chakra-button": { // targets the chakra button class to set bg transparency
"&:hover": {
bg: "transparent",
}
},
"& button": { "& button": {
transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease", transition: "opacity 0.3s ease, visibility 0.3s ease, margin 0.3s ease",
_hover: {
bg: "transparent",
}
} }
}, },
}, },
variants: { variants: {
state: { state: {
open: { open: {
root: { width: "190px" }, root: {width: "190px"},
button_text: {ml: 3, opacity: 1, visibility: "visible"}, button_text: {ml: 3, opacity: 1, visibility: "visible"},
logo_text: {ml: 3, opacity: 1, visibility: "visible"}, logo_text: {ml: 3, opacity: 1, visibility: "visible", transition: "opacity 0.5s ease, visibility 0.5s ease, margin 0.5s ease"},
opened_theme_button: {"& button": {opacity: 1, visibility: "visible"}}, opened_theme_button: {"& button": {opacity: 1, visibility: "visible"}},
closed_theme_button: {"& button": {opacity: 0, visibility: "hidden"}}, closed_theme_button: {"& button": {opacity: 0, visibility: "hidden"}},
}, },
closed: { closed: {
root: { width: "71px" }, root: {width: "71px"},
button_text: {opacity: 0, visibility: "hidden"}, button_text: {opacity: 0, visibility: "hidden"},
logo_text: {opacity: 0, visibility: "hidden"}, logo_text: {opacity: 0, visibility: "hidden", transition: "opacity 0.2s ease, visibility 0.2s ease, margin 0.2s ease"},
opened_theme_button: {"& button": {opacity: 0, visibility: "hidden"}}, opened_theme_button: {"& button": {opacity: 0, visibility: "hidden"}},
closed_theme_button: {"& button": {opacity: 1, visibility: "visible"}}, closed_theme_button: {"& button": {opacity: 1, visibility: "visible"}},
} }
@@ -255,6 +252,45 @@ const canvasRecipe = defineRecipe({
} }
}); });
const homeRecipe = defineSlotRecipe({
slots: ["root"],
base: {
root: {
flexDirection: "column",
height: "100%",
width: "100%",
// Flex contianer as a header that contains all the tabs
"& header": {
width: "100%",
align: "center",
justify: "space-between",
top: "0",
p: 5,
position: "sticky",
zIndex: "dropdown",
bg: "transparent",
// Flex container renders as div for all the buttons within the header
"& > div": {
alignItems: "center",
gap: 2,
// icon in each tab button
"& svg": {
// TODO: bring over svg styling
}
}
},
"& > div": {
flex: 1,
overflow: "auto",
}
},
},
})
// const widgetRecipe = defineSlotRecipe({ // const widgetRecipe = defineSlotRecipe({
// slots: ["root", "header", "canvas"], // slots: ["root", "header", "canvas"],
// base: { // base: {
@@ -331,7 +367,7 @@ const glassPanelRecipe = defineSlotRecipe({
boxShadow: "xl", boxShadow: "xl",
minW: "240px", minW: "240px",
// OVERRIDES: Make the background 85-90% opaque instead of 40% // OVERRIDES: Make the background 85-90% opaque instead of 40%
bg: { base: "rgba(255, 255, 255, 0.75)", _dark: "rgba(20, 22, 25, 0.8)" }, bg: {base: "rgba(255, 255, 255, 0.75)", _dark: "rgba(20, 22, 25, 0.8)"},
// OVERRIDES: Increase the blur just to smooth out any stubborn gridlines // OVERRIDES: Increase the blur just to smooth out any stubborn gridlines
backdropFilter: "blur(15px)", backdropFilter: "blur(15px)",
@@ -375,7 +411,7 @@ const glassTabRecipe = defineRecipe({
overflow: "hidden", overflow: "hidden",
whiteSpace: "nowrap", whiteSpace: "nowrap",
textDecoration: "none", textDecoration: "none",
fontWeight: "bold", fontWeight: "500",
color: "fg.muted", color: "fg.muted",
// --- THE GLASS EFFECT (Inactive) --- // --- THE GLASS EFFECT (Inactive) ---
@@ -418,7 +454,7 @@ const glassTabRecipe = defineRecipe({
} }
}); });
const config= defineConfig({ const config = defineConfig({
globalCss: { globalCss: {
".react-grid-placeholder": { ".react-grid-placeholder": {
background: "#c0d2e3ff !important", background: "#c0d2e3ff !important",
@@ -500,8 +536,8 @@ const config= defineConfig({
// primaryLt: {value: {base: "#98cdffff", _dark: "#98cdffff"}}, // primaryLt: {value: {base: "#98cdffff", _dark: "#98cdffff"}},
// secondaryBG: {value: {base: "#EDF1F1", _dark: "#121212"}}, // secondaryBG: {value: {base: "#EDF1F1", _dark: "#121212"}},
// border: {value: {base: "#000000", _dark: "#cbcbcb84"}}, // border: {value: {base: "#000000", _dark: "#cbcbcb84"}},
// text: {value: {base: "#000000", _dark: "#FFFFFF"}}, text: {value: {base: "#000000", _dark: "#FFFFFF"}},
// textInverted: {value: {base: "#000000", _dark: "#FFFFFF"}}, textInverted: {value: {base: "#000000", _dark: "#FFFFFF"}},
// icon: {value: {base: "#000000", _dark: "#FFFFFF"}}, // icon: {value: {base: "#000000", _dark: "#FFFFFF"}},
gooeyButtonBackground: {value: {base: "rgba(255, 255, 255, 0.1)", _dark: "rgba(255, 255, 255, 0.1)"}}, gooeyButtonBackground: {value: {base: "rgba(255, 255, 255, 0.1)", _dark: "rgba(255, 255, 255, 0.1)"}},
@@ -526,6 +562,7 @@ const config= defineConfig({
sidebar: sidebarRecipe, sidebar: sidebarRecipe,
// widget: widgetRecipe, // widget: widgetRecipe,
glassPanel: glassPanelRecipe, glassPanel: glassPanelRecipe,
home: homeRecipe,
}, },
}, },
}); });