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

demo: Council secondary colours #2566

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 13 additions & 0 deletions editor.planx.uk/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,18 @@
To begin the development, run `pnpm start`.
To create a production bundle, use `pnpm build`.
-->

<!-- Manually add team body class for demo -->
<script>
const [team] = window.location.pathname
.split("/")
.map((value) => value.replaceAll("-", " "))
.slice(1, 3);

const body = document.body;
body.classList.remove(...body.classList);
body.classList.add("team--" + team);
</script>
<!-- end demo script -->
</body>
</html>
40 changes: 40 additions & 0 deletions editor.planx.uk/src/councilStyles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Light/dark text to contrast button background color
$text-black: #0b0c0c;
$text-white: #ffffff;

// Action colour per council
.MuiButton-containedPrimary:not(.Mui-disabled),
.arrowButton {
body.team--buckinghamshire & {
color: $text-black;
background: #96bb36;
}
body.team--canterbury & {
color: $text-black;
background: #f9b400;
}
body.team--camden & {
color: $text-black;
background: #ead95b;
}
body.team--lambeth & {
color: $text-white;
background: #069;
}
body.team--braintree & {
color: $text-white;
background: #005e8a;
}
body.team--gateshead & {
color: $text-white;
background: #045a90;
}
body.team--gloucester & {
color: $text-white;
background: #0054a4;
}
body.team--newcastle & {
color: $text-white;
background: #1111d5;
}
}
3 changes: 3 additions & 0 deletions editor.planx.uk/src/themeOverrides.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ declare module "@mui/material/styles/createPalette" {
border?: { main: string; input: string; light: string };
}
}

// Import council specific CSS for demo purposes
import "./councilStyles.scss";
Loading