Skip to content

Commit

Permalink
demo: Council secondary colours
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjon3s committed Dec 14, 2023
1 parent cb4c7a3 commit 8aa0dc9
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
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";

0 comments on commit 8aa0dc9

Please sign in to comment.