From 8bb55b74f5b93fe47063fe94043d6b67c7a6af11 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Sat, 12 Apr 2025 17:05:17 +0200 Subject: [PATCH] Change sun color/background --- src/components/Theme/ThemeSelector.tsx | 66 +++++++++++++------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/components/Theme/ThemeSelector.tsx b/src/components/Theme/ThemeSelector.tsx index 5b55f53..dbf9d90 100644 --- a/src/components/Theme/ThemeSelector.tsx +++ b/src/components/Theme/ThemeSelector.tsx @@ -1,58 +1,58 @@ -import { useThemeContext } from "./ThemeContext"; -import { styled, Switch } from "@mui/material"; +import { useThemeContext } from './ThemeContext'; +import { styled, Switch } from '@mui/material'; const ThemeSwitch = styled(Switch)(({ theme }) => ({ width: 62, height: 34, padding: 7, - "& .MuiSwitch-switchBase": { + '& .MuiSwitch-switchBase': { margin: 1, padding: 0, - transform: "translateX(6px)", - "&.Mui-checked": { - color: "#fff", - transform: "translateX(22px)", - "& .MuiSwitch-thumb:before": { + transform: 'translateX(6px)', + '&.Mui-checked': { + color: '#fff', + transform: 'translateX(22px)', + '& .MuiSwitch-thumb:before': { backgroundImage: `url('data:image/svg+xml;utf8,')`, }, - "& + .MuiSwitch-track": { + '& + .MuiSwitch-track': { opacity: 1, - backgroundColor: "#aab4be", - ...theme.applyStyles("dark", { - backgroundColor: "#8796A5", + backgroundColor: '#aab4be', + ...theme.applyStyles('dark', { + backgroundColor: '#8796A5', }), }, }, }, - "& .MuiSwitch-thumb": { - backgroundColor: "#001e3c", + '& .MuiSwitch-thumb': { + backgroundColor: '#fde402', width: 32, height: 32, - "&::before": { + '&::before': { content: "''", - position: "absolute", - width: "100%", - height: "100%", + position: 'absolute', + width: '100%', + height: '100%', left: 0, top: 0, - backgroundRepeat: "no-repeat", - backgroundPosition: "center", + backgroundRepeat: 'no-repeat', + backgroundPosition: 'center', backgroundImage: `url('data:image/svg+xml;utf8,')`, }, - ...theme.applyStyles("dark", { - backgroundColor: "#003892", + ...theme.applyStyles('dark', { + backgroundColor: '#003892', }), }, - "& .MuiSwitch-track": { + '& .MuiSwitch-track': { opacity: 1, - backgroundColor: "#aab4be", + backgroundColor: '#aab4be', borderRadius: 20 / 2, - ...theme.applyStyles("dark", { - backgroundColor: "#8796A5", + ...theme.applyStyles('dark', { + backgroundColor: '#8796A5', }), }, })); @@ -62,14 +62,14 @@ const ThemeSelector = ({ style }) => { return (
- +
); };