Skip to content

Commit aa9100a

Browse files
committed
Color improvements
1 parent cf91fe8 commit aa9100a

7 files changed

Lines changed: 38 additions & 13 deletions

File tree

src/components/EditorPanel/EditorPanel.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,19 @@ export const EditorPanel = () => {
2626
}}
2727
>
2828
{BUTTON_DATA.map(({ name, icon }) => (
29-
<Button key={name} variant={section === name ? "contained" : "outlined"} onClick={() => setSection(name)} sx={{ py: 1 }}>
29+
<Button
30+
key={name}
31+
variant={section === name ? "contained" : "outlined"}
32+
onClick={() => setSection(name)}
33+
sx={{
34+
py: 1,
35+
...(section === name && {
36+
"&:hover": {
37+
bgcolor: section === name ? "primary.main" : undefined,
38+
},
39+
}),
40+
}}
41+
>
3042
<Stack sx={{ gap: 1, alignItems: "center" }}>
3143
{icon}
3244
<Stack sx={{ placeContent: "center", height: 24 }}>

src/components/FieldContainer/FieldContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const FieldContainer = ({ title, children, isDefault, onReset, titleSx }:
4545
}}
4646
>
4747
{isDefault ? (
48-
<Typography variant="subtitle2" color="textDisabled" sx={{ fontSize: 11 }}>
48+
<Typography variant="subtitle2" sx={{ fontSize: 11, color: "text.disabled" }}>
4949
auto
5050
</Typography>
5151
) : (

src/components/InfoPanel/InfoPanel.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const InfoPanel = () => {
1919
>
2020
<Stack>
2121
<Typography variant="h5">MUI&nbsp;Theme&nbsp;Builder</Typography>
22-
<Typography variant="subtitle2" color="text.secondary">
22+
<Typography variant="subtitle2" sx={{ color: "text.secondary" }}>
2323
Compatible with MUI 5 to 9
2424
</Typography>
2525
</Stack>
@@ -76,10 +76,10 @@ export const InfoPanel = () => {
7676
{hasEditedTheme && (
7777
<Stack
7878
direction="row"
79-
sx={{ gap: 0.5, borderRadius: "99px", bgcolor: "background.default", p: 0.5, paddingInlineEnd: 1, alignContent: "center" }}
79+
sx={{ gap: 0.5, borderRadius: "99px", bgcolor: "common.black", p: 0.5, paddingInlineEnd: 1, alignContent: "center" }}
8080
>
8181
<Check color="success" fontSize="small" />
82-
<Typography variant="subtitle2" color="text.secondary">
82+
<Typography variant="subtitle2" sx={{ color: "text.secondary" }}>
8383
Changes&nbsp;saved&nbsp;locally
8484
</Typography>
8585
</Stack>
@@ -88,13 +88,13 @@ export const InfoPanel = () => {
8888
<Typography variant="h6">Components</Typography>
8989
<ComponentList />
9090
<Divider />
91-
<Typography variant="subtitle2" color="text.secondary">
91+
<Typography variant="subtitle2" sx={{ color: "text.secondary" }}>
9292
Inspired by{" "}
9393
<Link href="https://bareynol.github.io/mui-theme-creator" target="_blank">
9494
@bareynol
9595
</Link>
9696
</Typography>
97-
<Typography variant="subtitle2" color="text.secondary">
97+
<Typography variant="subtitle2" sx={{ color: "text.secondary" }}>
9898
Made with ❤️ by{" "}
9999
<Link href="https://www.linkedin.com/in/peter-ty-liu/" target="_blank">
100100
Peter Liu

src/components/MockApp/MockApp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export const MockApp = () => {
267267
<StyledTableBodyCell>
268268
<Box>
269269
<Typography>{data.customer}</Typography>
270-
<Typography variant="subtitle2" color="textSecondary">
270+
<Typography variant="subtitle2" sx={{ color: "text.secondary" }}>
271271
{data.orderer}
272272
</Typography>
273273
</Box>

src/components/Sparkline/Sparkline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const Sparkline = ({ title, data, icon }: { title: string; data: Array<Da
4040
</Stack>
4141

4242
<Stack direction="row" sx={{ containerType: "inline-size", alignItems: "flex-end", justifyContent: "space-between" }}>
43-
<Typography variant="h6" color="textSecondary">
43+
<Typography variant="h6" sx={{ color: "text.secondary" }}>
4444
{downloads[weekIndex ?? downloads.length - 1].toLocaleString()}
4545
</Typography>
4646
<Box

src/components/TextEditor.tsx/TextEditor.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,15 @@ export const TextEditor = () => {
9898
}
9999
}}
100100
fullWidth
101+
slotProps={{ listbox: { sx: { border: 1, borderColor: "#444" } } }}
101102
renderInput={(params) => <TextField {...params} />}
102103
renderGroup={(params) => (
103104
<li key={params.key}>
104-
<Box sx={{ bgcolor: "primary.dark", p: 0.5 }}>{params.group}</Box>
105+
<Box sx={{ p: 0.5 }}>
106+
<Typography variant="caption" sx={{ textTransform: "uppercase", color: "text.secondary" }}>
107+
{params.group}
108+
</Typography>
109+
</Box>
105110
<div>{params.children}</div>
106111
</li>
107112
)}

src/components/ToolsPanel/ToolsPanel.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import { Code, Edit } from "@mui/icons-material";
2-
import { Paper, Tab, Tabs } from "@mui/material";
2+
import { Paper, Tab, Tabs, type SxProps } from "@mui/material";
33
import { Activity, useState } from "react";
44
import { CodePanel } from "../CodePanel/CodePanel";
55
import { EditorPanel } from "../EditorPanel/EditorPanel";
66

7+
const TABS_SX: SxProps = {
8+
minHeight: "48px",
9+
transition: "0.2s color",
10+
"&:hover": {
11+
color: "primary.main",
12+
},
13+
};
14+
715
export const ToolsPanel = () => {
816
const [tab, setTab] = useState<"editor" | "code">("editor");
917
return (
@@ -16,8 +24,8 @@ export const ToolsPanel = () => {
1624
}}
1725
>
1826
<Tabs variant="fullWidth" onChange={(_, value) => setTab(value)} value={tab} sx={{ borderBottom: 1, borderColor: "divider" }}>
19-
<Tab icon={<Edit />} iconPosition="start" sx={{ minHeight: "48px" }} label="Editor" value="editor" />
20-
<Tab icon={<Code />} iconPosition="start" sx={{ minHeight: "48px" }} label="Code" value="code" />
27+
<Tab icon={<Edit />} iconPosition="start" sx={TABS_SX} label="Editor" value="editor" />
28+
<Tab icon={<Code />} iconPosition="start" sx={TABS_SX} label="Code" value="code" />
2129
</Tabs>
2230
<Activity mode={tab === "editor" ? "visible" : "hidden"}>
2331
<EditorPanel />

0 commit comments

Comments
 (0)