make login form use dark/light theme

This commit is contained in:
Aine 2024-11-18 12:48:20 +02:00
parent c28ed94ca0
commit 86d0fd04e6
No known key found for this signature in database
GPG key ID: 34969C908CCA2804

View file

@ -2,57 +2,58 @@ import { styled } from "@mui/material/styles";
import { Box } from "@mui/material"; import { Box } from "@mui/material";
const LoginFormBox = styled(Box)(({ theme }) => ({ const LoginFormBox = styled(Box)(({ theme }) => ({
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
minHeight: "calc(100vh - 1rem)", minHeight: "calc(100vh - 1rem)",
alignItems: "center", alignItems: "center",
justifyContent: "flex-start", justifyContent: "flex-start",
background: "url(./images/floating-cogs.svg)", background: "url(./images/floating-cogs.svg)",
backgroundColor: "#f9f9f9", backgroundColor: theme.palette.mode === 'dark' ? theme.palette.background.default : theme.palette.background.paper,
backgroundRepeat: "no-repeat", backgroundRepeat: "no-repeat",
backgroundSize: "cover", backgroundSize: "cover",
[`& .card`]: { [`& .card`]: {
width: "30rem", width: "30rem",
marginTop: "6rem", marginTop: "6rem",
marginBottom: "6rem", marginBottom: "6rem",
}, },
[`& .avatar`]: { [`& .avatar`]: {
margin: "1rem", margin: "1rem",
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
}, },
[`& .icon`]: { [`& .icon`]: {
backgroundColor: theme.palette.grey[500], backgroundColor: theme.palette.grey[500],
}, },
[`& .hint`]: { [`& .hint`]: {
marginTop: "1em", marginTop: "1em",
marginBottom: "1em", marginBottom: "1em",
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
color: theme.palette.grey[600], color: theme.palette.grey[600],
}, },
[`& .form`]: { [`& .form`]: {
padding: "0 1rem 1rem 1rem", padding: "0 1rem 1rem 1rem",
}, },
[`& .select`]: { [`& .select`]: {
marginBottom: "2rem", marginBottom: "2rem",
}, },
[`& .actions`]: { [`& .actions`]: {
padding: "0 1rem 1rem 1rem", padding: "0 1rem 1rem 1rem",
}, },
[`& .serverVersion`]: { [`& .serverVersion`]: {
color: theme.palette.grey[500], color: theme.palette.grey[500],
fontFamily: "Roboto, Helvetica, Arial, sans-serif", fontFamily: "Roboto, Helvetica, Arial, sans-serif",
marginLeft: "0.5rem", marginLeft: "0.5rem",
}, },
[`& .matrixVersions`]: { [`& .matrixVersions`]: {
color: theme.palette.grey[500], color: theme.palette.grey[500],
fontFamily: "Roboto, Helvetica, Arial, sans-serif", fontFamily: "Roboto, Helvetica, Arial, sans-serif",
fontSize: "0.8rem", fontSize: "0.8rem",
marginBottom: "1rem", marginBottom: "1rem",
marginLeft: "0.5rem", marginLeft: "0.5rem",
}, },
})); }
));
export default LoginFormBox; export default LoginFormBox;