Skip to content

Commit

Permalink
feat: Apply theme colours across app
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjon3s committed Jan 12, 2024
1 parent e840e7d commit 51fc3f9
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Content/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Content = styled(Box, {
theme.palette.text.primary,
])?.toHexString() || theme.palette.text.primary,
"& a": {
color: getContrastTextColor(color || "#fff", theme.palette.primary.main),
color: getContrastTextColor(color || "#fff", theme.palette.link.main),
},
"& *:first-child": {
marginTop: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const FileTaggingModal = ({
<Box>
<Button
variant="contained"
color="prompt"
onClick={handleValidation}
data-testid="modal-done-button"
>
Expand Down Expand Up @@ -202,7 +203,7 @@ const SelectMultiple = (props: SelectMultipleProps) => {
sx={{
top: "16%",
textDecoration: "underline",
color: (theme) => theme.palette.primary.main,
color: (theme) => theme.palette.link.main,
"&[data-shrink=true]": {
textDecoration: "none",
color: (theme) => theme.palette.text.primary,
Expand Down Expand Up @@ -284,6 +285,7 @@ const SelectMultiple = (props: SelectMultipleProps) => {
</Typography>
<Button
variant="contained"
color="prompt"
onClick={handleClose}
aria-label="Close list"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export const InfoButton = styled(Button)(({ theme }) => ({
minWidth: 0,
marginLeft: theme.spacing(1.5),
boxShadow: "none",
color: theme.palette.primary.main,
minHeight: "44px",
})) as typeof Button;

Expand Down
12 changes: 8 additions & 4 deletions editor.planx.uk/src/@planx/components/Notice/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ const Container = styled(Box, {
justifyContent: "space-between",
padding: theme.spacing(2),
backgroundColor: customColor,
color: mostReadable(customColor, [
"#fff",
theme.palette.text.primary,
])?.toHexString(),
color:
mostReadable(customColor || "#fff", [
"#fff",
theme.palette.text.primary,
])?.toHexString() || theme.palette.text.primary,
"& a": {
color: "inherit !important",
},
"&:before": {
content: "' '",
position: "absolute",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Card: React.FC<Props> = ({
{handleSubmit && (
<Button
variant="contained"
color="primary"
color="prompt"
size="large"
type="submit"
disabled={!isValid}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface RootProps extends ButtonBaseProps {
}

const FauxLink = styled(Box)(({ theme }) => ({
color: theme.palette.primary.main,
color: theme.palette.link.main,
textDecoration: "underline",
whiteSpace: "nowrap",
}));
Expand Down
4 changes: 2 additions & 2 deletions editor.planx.uk/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { TeamTheme } from "@opensystemslab/planx-core/types";
import { getContrastTextColor } from "styleUtils";

const DEFAULT_PRIMARY_COLOR = "#0010A4";
const DEFAULT_TONAL_OFFSET = 0.2;
const DEFAULT_TONAL_OFFSET = 0.1;

// Type styles
export const FONT_WEIGHT_SEMI_BOLD = "600";
Expand Down Expand Up @@ -252,7 +252,7 @@ const getThemeOptions = ({ primaryColour, linkColour, actionColour}: TeamTheme):
{
props: { variant: "help" },
style: {
color: palette.primary.main,
color: palette.link.main,
boxShadow: "none",
padding: "0.25em 0.1em",
width: "auto",
Expand Down
7 changes: 4 additions & 3 deletions editor.planx.uk/src/ui/public/NextStepsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ const innerStyle = (theme: Theme) => ({
textDecoration: "none",
borderBottom: `1px solid theme.palette.text.secondary`,
"&:hover > .arrowButton": {
backgroundColor: theme.palette.primary.dark,
backgroundColor: theme.palette.prompt.dark,
},
"&:focus > .arrowButton": {
backgroundColor: theme.palette.text.primary,
color: theme.palette.common.white,
},
});

Expand All @@ -67,8 +68,8 @@ const ArrowButton = styled("span")(({ theme }) => ({
display: "flex",
justifyContent: "center",
alignItems: "center",
backgroundColor: theme.palette.primary.main,
color: theme.palette.common.white,
backgroundColor: theme.palette.prompt.main,
color: theme.palette.prompt.contrastText,
width: "50px",
height: "50px",
flexShrink: "0",
Expand Down

0 comments on commit 51fc3f9

Please sign in to comment.