Skip to content

Commit

Permalink
made theme optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jordantrouw committed Dec 13, 2024
1 parent fa1e221 commit a9c0254
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/theme/src/product-theme/xylabs/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { darkThemeOptions } from './darkThemeOptions.tsx'
import { lightThemeOptions } from './lightThemeOptions.tsx'

export const XyLabsTheme = (theme: Theme): Theme => createTheme({
export const XyLabsTheme = (_theme?: Theme): Theme => createTheme({
colorSchemes: {
light: lightThemeOptions,
dark: darkThemeOptions,
Expand Down
21 changes: 10 additions & 11 deletions packages/theme/src/product-theme/xyo/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { shapeFragment, spacingFragment } from '../../theme-fragments/index.ts'
import { darkThemeOptions } from './darkThemeOptions.tsx'
import { lightThemeOptions } from './lightThemeOptions.tsx'

export const XyoTheme = (theme: Theme, rtl = false): Theme => createTheme({
export const XyoTheme = (_theme?: Theme, rtl = false): Theme => createTheme({
colorSchemes: {
dark: darkThemeOptions,
light: lightThemeOptions,
Expand All @@ -26,29 +26,28 @@ export const XyoTheme = (theme: Theme, rtl = false): Theme => createTheme({
components: {
MuiAlert: {
styleOverrides: {
root: {
root: ({ theme }) => ({
backgroundColor: alpha(theme.palette.background.paper, 0.3),
color: 'inherit',
},
standardError: { backgroundColor: alpha(theme.palette.error.main, 0.3), color: theme.palette.error.light },
standardInfo: { backgroundColor: alpha(theme.palette.info.main, 0.3), color: theme.palette.info.light },
standardSuccess: { backgroundColor: alpha(theme.palette.success.main, 0.3), color: theme.palette.success.light },
standardWarning: { backgroundColor: alpha(theme.palette.warning.main, 0.3), color: theme.palette.warning.light },
}),
standardError: ({ theme }) => ({ backgroundColor: alpha(theme.palette.error.main, 0.3), color: theme.palette.error.light }),
standardInfo: ({ theme }) => ({ backgroundColor: alpha(theme.palette.info.main, 0.3), color: theme.palette.info.light }),
standardSuccess: ({ theme }) => ({ backgroundColor: alpha(theme.palette.success.main, 0.3), color: theme.palette.success.light }),
standardWarning: ({ theme }) => ({ backgroundColor: alpha(theme.palette.warning.main, 0.3), color: theme.palette.warning.light }),
},
},
MuiButton: {
styleOverrides: {
root: {
boxShadow: 'none',
// padding: `${theme.spacing(1)} ${theme.spacing(2)}`,
borderWidth: '2px',
borderColor: 'inherit',
},
},
variants: [
{
props: { variant: 'outlined' },
style: {
style: ({ theme }) => ({
'WebkitBackdropFilter': 'blur(2px)',
'backdropFilter': 'blur(2px)',
'border': `2px solid ${alpha(theme.palette.text.primary, 0.4)}`,
Expand All @@ -58,11 +57,11 @@ export const XyoTheme = (theme: Theme, rtl = false): Theme => createTheme({
border: `2px solid ${alpha(theme.palette.text.primary, 0)}`,
color: darken(theme.palette.primary.dark, 0.7),
},
},
}),
},
{
props: { size: 'small' },
style: { padding: `${theme.spacing(0.5)} ${theme.spacing(1)}` },
style: ({ theme }) => ({ padding: `${theme.spacing(0.5)} ${theme.spacing(1)}` }),
},
],
},
Expand Down

0 comments on commit a9c0254

Please sign in to comment.