From cfa31a99a33f0bf8bde31370c0e3a06b27979ee3 Mon Sep 17 00:00:00 2001 From: m-tartari <37861893+m-tartari@users.noreply.github.com> Date: Thu, 3 Jul 2025 09:25:18 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(theme):=20split?= =?UTF-8?q?=20style=20into=20separate=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/style/palette/index.ts | 31 ++++++++++++++++ src/style/theme.ts | 66 +++++++++-------------------------- src/style/typography/index.ts | 26 ++++++++++++++ 3 files changed, 73 insertions(+), 50 deletions(-) create mode 100644 src/style/palette/index.ts create mode 100644 src/style/typography/index.ts diff --git a/src/style/palette/index.ts b/src/style/palette/index.ts new file mode 100644 index 0000000..7dae129 --- /dev/null +++ b/src/style/palette/index.ts @@ -0,0 +1,31 @@ +import { PaletteOptions } from '@mui/material' + +export const dark: PaletteOptions = { + mode: 'dark', + primary: { + main: '#e44c65', // Rouge Red (similar) + // main:'#df4661', // Pantone PMS 198 C + }, + secondary: { + main: '#3f51b5', // Early Spring Night (similar) + // main: '#3a5dae', // Pantone 7455 C Color + }, + background: { + default: '#101018', + paper: '#1b1d27', + }, +} +export const light: PaletteOptions = { + primary: { + main: '#AC1D1B', // Casual Red + // main: '#AF231C' // Pantone 2350 C + // main: '#AB2328' // Pantone 7621 C + }, + secondary: { + main: '#006269', // Pantone 7715 C + }, + background: { default: '#fafafa', paper: '#eeeeee' }, // Light background + text: { secondary: '#666' }, // Dark text for readability +} + +export default { dark, light } diff --git a/src/style/theme.ts b/src/style/theme.ts index cc58e6c..63435e8 100644 --- a/src/style/theme.ts +++ b/src/style/theme.ts @@ -1,58 +1,24 @@ /* istanbul ignore file */ import { createTheme, responsiveFontSizes } from '@mui/material/styles' -// A custom theme for this app -let theme = createTheme({ - typography: { - fontFamily: 'Inter, sans-serif', // Base font for headings - h1: { - fontFamily: 'Oswald, sans-serif', - textTransform: 'uppercase', - fontWeight: 700, - }, - h2: { - fontFamily: 'Oswald, sans-serif', - textTransform: 'uppercase', - fontWeight: 700, - }, - h3: { - fontFamily: 'Oswald, sans-serif', - fontWeight: 700, - }, - h4: { - fontFamily: 'Oswald, sans-serif', - fontWeight: 700, - }, - }, +import typography from './typography/index.js' +import palette from './palette/index.js' + +let theme = createTheme({ + typography: typography, colorSchemes: { - dark: { - palette: { - primary: { - main: '#e44c65', // Rouge Red (similar) - // main:'#df4661', // Pantone PMS 198 C + light: { palette: palette.light }, + dark: { palette: palette.dark }, + }, + components: { + MuiCollapse: { + styleOverrides: { + hidden: { + '@media print': { + visibility: 'visible', + height: 'auto', + }, }, - secondary: { - main: '#3f51b5', // Early Spring Night (similar) - // main: '#3a5dae', // Pantone 7455 C Color - }, - background: { - default: '#101018', - paper: '#1b1d27', - }, - }, - }, - light: { - palette: { - primary: { - main: '#AC1D1B', // Casual Red - // main: '#AF231C' // Pantone 2350 C - // main: '#AB2328' // Pantone 7621 C - }, - secondary: { - main: '#006269', // Pantone 7715 C - }, - background: { default: '#fafafa', paper: '#eeeeee' }, // Light background - text: { secondary: '#666' }, // Dark text for readability }, }, }, diff --git a/src/style/typography/index.ts b/src/style/typography/index.ts new file mode 100644 index 0000000..231559e --- /dev/null +++ b/src/style/typography/index.ts @@ -0,0 +1,26 @@ +import { TypographyVariantsOptions } from '@mui/material' + +const typography: TypographyVariantsOptions = { + fontFamily: 'Inter, sans-serif', // Base font for headings + + h1: { + fontFamily: 'Oswald, sans-serif', + textTransform: 'uppercase', + fontWeight: 700, + }, + h2: { + fontFamily: 'Oswald, sans-serif', + textTransform: 'uppercase', + fontWeight: 700, + }, + h3: { + fontFamily: 'Oswald, sans-serif', + fontWeight: 700, + }, + h4: { + fontFamily: 'Oswald, sans-serif', + fontWeight: 700, + }, +} + +export default typography