feat: removing colors from global theme

This commit is contained in:
Caio Cabral committed 2024-11-12 17:24:21 -05:00
1 parent aa1b73c305
commit 841bf7b5ed
1 file changed
+35 -49
+35 -49
View File
@@ -3,27 +3,11 @@ import { paletteLight, typographyLevels } from "./constants";
const fontFamilyPrimary = '"Inter" , sans-serif'; const fontFamilyPrimary = '"Inter" , sans-serif';
// const fontFamilySecondary = '"Avenir", sans-serif'; // const fontFamilySecondary = '"Avenir", sans-serif';
/* TODO take the color out from here */
const shadow = const shadow =
"0px 4px 24px -4px rgba(16, 24, 40, 0.08), 0px 3px 3px -3px rgba(16, 24, 40, 0.03)"; "0px 4px 24px -4px rgba(16, 24, 40, 0.08), 0px 3px 3px -3px rgba(16, 24, 40, 0.03)";
const background = {
main: "#FFFFFF",
alt: "#FCFCFD",
fill: "#F4F4F4",
accent: "#f9fafb",
};
const border = { light: "#eaecf0", dark: "#d0d5dd" };
const text = {
primary: "#1c2130",
secondary: "#344054",
tertiary: "#475467",
accent: "#838c99",
};
const baseTheme = { const baseTheme = {
/* TODO colors should not live here */
typography: { typography: {
fontFamily: fontFamilyPrimary, fontFamily: fontFamilyPrimary,
fontSize: 14, fontSize: 14,
@@ -111,27 +95,29 @@ const baseTheme = {
}, },
MuiIconButton: { MuiIconButton: {
styleOverrides: { styleOverrides: {
root: { root: ({ theme }) => ({
padding: 4, padding: 4,
transition: "none", transition: "none",
"&:hover": { "&:hover": {
backgroundColor: background.fill, backgroundColor: theme.palette.background.fill,
}, },
}, }),
}, },
}, },
MuiPaper: { MuiPaper: {
styleOverrides: { styleOverrides: {
root: { root: ({ theme }) => {
marginTop: 4, return {
padding: 0, marginTop: 4,
border: 1, padding: 0,
borderStyle: "solid", border: 1,
borderColor: border.light, borderStyle: "solid",
borderRadius: 4, borderColor: theme.palette.border.light,
boxShadow: shadow, borderRadius: 4,
backgroundColor: background.main, boxShadow: shadow,
backgroundImage: "none", backgroundColor: theme.palette.background.main,
backgroundImage: "none",
};
}, },
}, },
}, },
@@ -151,61 +137,61 @@ const baseTheme = {
}, },
MuiMenuItem: { MuiMenuItem: {
styleOverrides: { styleOverrides: {
root: { root: ({ theme }) => ({
borderRadius: 4, borderRadius: 4,
backgroundColor: "inherit", backgroundColor: "inherit",
padding: "4px 6px", padding: "4px 6px",
color: text.secondary, color: theme.palette.text.secondary,
fontSize: 13, fontSize: 13,
margin: 2, margin: 2,
minWidth: 100, minWidth: 100,
"&:hover, &.Mui-selected, &.Mui-selected:hover, &.Mui-selected.Mui-focusVisible": "&:hover, &.Mui-selected, &.Mui-selected:hover, &.Mui-selected.Mui-focusVisible":
{ {
backgroundColor: background.fill, backgroundColor: theme.palette.background.fill,
}, },
}, }),
}, },
}, },
MuiTableCell: { MuiTableCell: {
styleOverrides: { styleOverrides: {
root: { root: ({ theme }) => ({
borderBottomColor: border.light, borderBottomColor: theme.palette.border.light,
}, }),
}, },
}, },
MuiTableHead: { MuiTableHead: {
styleOverrides: { styleOverrides: {
root: { root: ({ theme }) => ({
backgroundColor: background.accent, backgroundColor: theme.palette.background.accent,
}, }),
}, },
}, },
MuiPagination: { MuiPagination: {
styleOverrides: { styleOverrides: {
root: { root: ({ theme }) => ({
backgroundColor: background.main, backgroundColor: theme.palette.background.main,
border: 1, border: 1,
borderStyle: "solid", borderStyle: "solid",
borderColor: border.light, borderColor: theme.palette.border.light,
"& button": { "& button": {
color: text.tertiary, color: theme.palette.text.tertiary,
borderRadius: 4, borderRadius: 4,
}, },
"& li:first-of-type button, & li:last-of-type button": { "& li:first-of-type button, & li:last-of-type button": {
border: 1, border: 1,
borderStyle: "solid", borderStyle: "solid",
borderColor: border.light, borderColor: theme.palette.border.light,
}, },
}, }),
}, },
}, },
MuiPaginationItem: { MuiPaginationItem: {
styleOverrides: { styleOverrides: {
root: { root: ({ theme }) => ({
"&:not(.MuiPaginationItem-ellipsis):hover, &.Mui-selected": { "&:not(.MuiPaginationItem-ellipsis):hover, &.Mui-selected": {
backgroundColor: background.fill, backgroundColor: theme.palette.background.fill,
}, },
}, }),
}, },
}, },
MuiSkeleton: { MuiSkeleton: {