mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-19 17:28:01 +00:00
remove styled components global styles
This commit is contained in:
12
src/App.tsx
12
src/App.tsx
@@ -1,24 +1,12 @@
|
|||||||
import { createGlobalStyle } from 'styled-components';
|
|
||||||
import { ThemeProvider } from '@mui/material';
|
import { ThemeProvider } from '@mui/material';
|
||||||
import { LifeTrinket } from './Components/LifeTrinket';
|
import { LifeTrinket } from './Components/LifeTrinket';
|
||||||
import { theme } from './Data/theme';
|
import { theme } from './Data/theme';
|
||||||
import { GlobalSettingsProvider } from './Providers/GlobalSettingsProvider';
|
import { GlobalSettingsProvider } from './Providers/GlobalSettingsProvider';
|
||||||
import { PlayersProvider } from './Providers/PlayersProvider';
|
import { PlayersProvider } from './Providers/PlayersProvider';
|
||||||
|
|
||||||
const GlobalStyles = createGlobalStyle`
|
|
||||||
html,
|
|
||||||
body {
|
|
||||||
background-color: ${theme.palette.background.default};
|
|
||||||
}
|
|
||||||
#root {
|
|
||||||
touch-action: manipulation;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<GlobalStyles />
|
|
||||||
<PlayersProvider>
|
<PlayersProvider>
|
||||||
<GlobalSettingsProvider>
|
<GlobalSettingsProvider>
|
||||||
<LifeTrinket />
|
<LifeTrinket />
|
||||||
|
|||||||
@@ -1,34 +1,27 @@
|
|||||||
import { createTheme } from '@mui/material';
|
import { createTheme } from '@mui/material';
|
||||||
|
import resolveConfig from 'tailwindcss/resolveConfig';
|
||||||
|
import tailwindConfig from '../../tailwind.config';
|
||||||
|
|
||||||
|
const fullConfig = resolveConfig(tailwindConfig);
|
||||||
|
|
||||||
|
const { primary, secondary, background, text, action, common } =
|
||||||
|
fullConfig.theme.colors;
|
||||||
|
|
||||||
export const theme = createTheme({
|
export const theme = createTheme({
|
||||||
palette: {
|
palette: {
|
||||||
primary: {
|
primary,
|
||||||
main: '#7F9172',
|
secondary,
|
||||||
},
|
background,
|
||||||
secondary: {
|
text,
|
||||||
main: '#5E714C',
|
action,
|
||||||
},
|
common,
|
||||||
background: {
|
|
||||||
default: '#495E35',
|
|
||||||
},
|
|
||||||
text: {
|
|
||||||
primary: '#F5F5F5',
|
|
||||||
secondary: '#b3b39b',
|
|
||||||
},
|
|
||||||
action: {
|
|
||||||
disabled: '#5E714C',
|
|
||||||
},
|
|
||||||
common: {
|
|
||||||
white: '#F9FFE3',
|
|
||||||
black: '#000000',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
MuiFormLabel: {
|
MuiFormLabel: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
root: {
|
root: {
|
||||||
fontSize: '1rem',
|
fontSize: '1rem',
|
||||||
color: '#F5F5F5',
|
color: text.primary,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -36,12 +29,12 @@ export const theme = createTheme({
|
|||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
markLabel: {
|
markLabel: {
|
||||||
fontSize: '1rem',
|
fontSize: '1rem',
|
||||||
color: '#F5F5F5',
|
color: text.primary,
|
||||||
},
|
},
|
||||||
valueLabel: {
|
valueLabel: {
|
||||||
display: 'none',
|
display: 'none',
|
||||||
color: '#F5F5F5',
|
color: text.primary,
|
||||||
background: '#5E714C',
|
background: secondary.main,
|
||||||
},
|
},
|
||||||
track: {
|
track: {
|
||||||
height: '0.7rem',
|
height: '0.7rem',
|
||||||
@@ -77,7 +70,7 @@ export const theme = createTheme({
|
|||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
paper: {
|
paper: {
|
||||||
top: '1rem',
|
top: '1rem',
|
||||||
background: '#495E35',
|
background: background.default,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
},
|
},
|
||||||
@@ -86,7 +79,7 @@ export const theme = createTheme({
|
|||||||
MuiBackdrop: {
|
MuiBackdrop: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
root: {
|
root: {
|
||||||
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
backgroundColor: background.backdrop,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -100,7 +93,7 @@ export const theme = createTheme({
|
|||||||
MuiSwitch: {
|
MuiSwitch: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
colorPrimary: {
|
colorPrimary: {
|
||||||
color: '#5E714C',
|
color: action.disabled,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
html,
|
||||||
body {
|
body {
|
||||||
|
background-color: theme('colors.background.default');
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||||
@@ -10,6 +12,9 @@ body {
|
|||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
#root {
|
||||||
|
touch-action: manipulation;
|
||||||
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import tailwindcssGridAreas from '@savvywombat/tailwindcss-grid-areas';
|
import tailwindcssGridAreas from '@savvywombat/tailwindcss-grid-areas';
|
||||||
|
import type { Config } from 'tailwindcss';
|
||||||
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
export default {
|
export default {
|
||||||
@@ -36,12 +37,29 @@ export default {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
colors: {
|
colors: {
|
||||||
|
primary: {
|
||||||
|
main: '#7F9172',
|
||||||
|
},
|
||||||
|
secondary: {
|
||||||
|
main: '#5E714C',
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
default: '#495E35',
|
||||||
|
backdrop: '#000000',
|
||||||
|
},
|
||||||
text: {
|
text: {
|
||||||
primary: '#F5F5F5',
|
primary: '#F5F5F5',
|
||||||
secondary: '#b3b39b',
|
secondary: '#b3b39b',
|
||||||
},
|
},
|
||||||
|
action: {
|
||||||
|
disabled: '#5E714C',
|
||||||
|
},
|
||||||
|
common: {
|
||||||
|
white: '#F9FFE3',
|
||||||
|
black: '#000000',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [tailwindcssGridAreas],
|
plugins: [tailwindcssGridAreas],
|
||||||
};
|
} satisfies Config;
|
||||||
Reference in New Issue
Block a user