Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Dark background colour as variable #3058

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions editor.planx.uk/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ const ProfileSection = styled(MuiToolbar)(({ theme }) => ({
marginRight: theme.spacing(1),
}));

const StyledPopover = styled(Popover)(() => ({
const StyledPopover = styled(Popover)(({ theme }) => ({
[`& .${popoverClasses.paper}`]: {
boxShadow: "4px 4px 0px rgba(150, 150, 150, 0.5)",
backgroundColor: "#2c2c2c",
backgroundColor: theme.palette.background.dark,
borderRadius: 0,
},
}));

const StyledPaper = styled(Paper)(({ theme }) => ({
backgroundColor: "#2c2c2c",
backgroundColor: theme.palette.background.dark,
color: "#fff",
borderRadius: 0,
boxShadow: "none",
Expand Down Expand Up @@ -130,7 +130,7 @@ const SkipLink = styled("a")(({ theme }) => ({
tabIndex: 0,
width: "100vw",
height: HEADER_HEIGHT / 2,
backgroundColor: "#2c2c2c",
backgroundColor: theme.palette.background.dark,
color: "#fff",
textDecoration: "underline",
padding: theme.spacing(1),
Expand Down
6 changes: 3 additions & 3 deletions editor.planx.uk/src/pages/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import React, { PropsWithChildren } from "react";

const Root = styled(Box)(() => ({
const Root = styled(Box)(({ theme }) => ({
backgroundColor: "#fff",
color: "#2C2C2C",
color: theme.palette.background.dark,
width: "100%",
flex: 1,
justifyContent: "flex-start",
Expand All @@ -14,7 +14,7 @@ const Root = styled(Box)(() => ({

const Dashboard = styled(Box)(({ theme }) => ({
backgroundColor: "#fff",
color: "#2C2C2C",
color: theme.palette.background.dark,
width: "100%",
maxWidth: 600,
margin: "auto",
Expand Down
6 changes: 3 additions & 3 deletions editor.planx.uk/src/pages/Team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { client } from "../lib/graphql";
import SimpleMenu from "../ui/editor/SimpleMenu";
import { useStore } from "./FlowEditor/lib/store";

const Root = styled(Box)(() => ({
backgroundColor: "#2C2C2C",
const Root = styled(Box)(({ theme }) => ({
backgroundColor: theme.palette.background.dark,
color: "#fff",
width: "100%",
flex: 1,
Expand All @@ -31,7 +31,7 @@ const Root = styled(Box)(() => ({
}));

const Dashboard = styled(Box)(({ theme }) => ({
backgroundColor: "#2C2C2C",
backgroundColor: theme.palette.background.dark,
color: "#fff",
width: "100%",
maxWidth: 600,
Expand Down
6 changes: 3 additions & 3 deletions editor.planx.uk/src/pages/Teams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ interface Props {
teams: Array<Team>;
}

const Root = styled(Box)(() => ({
backgroundColor: "#2C2C2C",
const Root = styled(Box)(({ theme }) => ({
backgroundColor: theme.palette.background.dark,
color: "#fff",
width: "100%",
flex: 1,
Expand All @@ -24,7 +24,7 @@ const Root = styled(Box)(() => ({
}));

const Dashboard = styled(Box)(({ theme }) => ({
backgroundColor: "#2C2C2C",
backgroundColor: theme.palette.background.dark,
color: "#fff",
width: "100%",
maxWidth: 600,
Expand Down
1 change: 1 addition & 0 deletions editor.planx.uk/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const DEFAULT_PALETTE: Partial<PaletteOptions> = {
background: {
default: "#FFFFFF",
paper: "#F9F8F8",
dark: "#2c2c2c",
},
secondary: {
main: "#F3F2F1",
Expand Down
12 changes: 12 additions & 0 deletions editor.planx.uk/src/themeOverrides.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ declare module "@mui/material/styles/createPalette" {
disabled: string;
placeholder: string;
}

interface TypeBackground {
main: string;
paper: string;
dark: string;
}

interface TypeBackgroundOptions {
main: string;
paper: string;
dark: string;
}
}

// Append our custom variants to MUI Button
Expand Down
Loading