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

feat: Apply theme colours across app #2658

Merged
merged 1 commit into from
Jan 17, 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
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
Loading