Skip to content

Commit

Permalink
minor fixes on font
Browse files Browse the repository at this point in the history
  • Loading branch information
Puyodead1 committed Aug 28, 2023
1 parent a41e338 commit c4f5568
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/components/AuthComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const HeaderContainer = styled.div`
export const Header = styled.h1`
margin-bottom: 3px;
color: var(--text);
font-weight: var(--font-weight-semibold);
font-weight: var(--font-weight-bold);
font-size: 24px;
`;

Expand Down Expand Up @@ -75,7 +75,7 @@ export const InputErrorText = styled.label`

export const InputLabel = styled.label`
font-size: 14px;
font-weight: var(--font-weight-semibold);
font-weight: var(--font-weight-bold);
`;

export const InputWrapper = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/components/HCaptcha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const HeaderContainer = styled.div`
`;

export const Header = styled.h1`
font-weight: var(--font-weight-semibold);
font-weight: var(--font-weight-bold);
margin-bottom: 8px;
font-size: 24px;
color: var(--text);
Expand Down
2 changes: 1 addition & 1 deletion src/components/messaging/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const MessageTimestamp = styled.div`

const MessageContent = styled.div<{ sending?: boolean; failed?: boolean }>`
font-size: 16px;
font-weight: var(--font-weight-thin);
font-weight: var(--font-weight-light);
white-space: pre-wrap;
word-wrap: anywhere;
opacity: ${(props) => (props.sending ? 0.5 : undefined)};
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/ModalComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const ModalCloseWrapper = styled.div`

export const ModalHeaderText = styled.h1`
font-size: 24px;
font-weight: var(--font-weight-black);
font-weight: var(--font-weight-bold);
color: var(--text-header);
text-align: center;
margin: 0;
Expand Down
47 changes: 23 additions & 24 deletions src/contexts/Theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ import { observer } from "mobx-react-lite";
import { createGlobalStyle } from "styled-components";
import { useAppStore } from "../stores/AppStore";

const font: ThemeFont["font"] = {
weight: {
thin: 100,
light: 300,
regular: 400,
medium: 500,
bold: 700,
black: 900,
},
};

export type ThemeVariables =
| "backgroundPrimary"
| "backgroundPrimaryAlt"
Expand Down Expand Up @@ -47,18 +58,22 @@ export type Overrides = {
[variable in ThemeVariables]: string;
};

export type OverridesWithFont = Overrides & {
export type ThemeFont = {
font: {
weight: {
thin: number;
regular: number;
medium: number;
semibold: number;
black: number;
thin?: number;
light?: number;
regular?: number;
medium?: number;
bold?: number;
semibold?: number;
black?: number;
};
};
};

export type OverridesWithFont = Overrides & ThemeFont;

export type Theme = OverridesWithFont & {
light?: boolean;
};
Expand Down Expand Up @@ -104,15 +119,7 @@ export const ThemePresets: Record<string, Theme> = {
warningContrastText: "",
scrollbarTrack: "",
scrollbarThumb: "",
font: {
weight: {
thin: 300,
regular: 400,
medium: 500,
semibold: 700,
black: 900,
},
},
font: font,
},
dark: {
backgroundPrimary: "#2e2e2e",
Expand Down Expand Up @@ -154,15 +161,7 @@ export const ThemePresets: Record<string, Theme> = {
warningContrastText: "#040404",
scrollbarTrack: "#232323",
scrollbarThumb: "#171717",
font: {
weight: {
thin: 300,
regular: 400,
medium: 500,
semibold: 700,
black: 900,
},
},
font: font,
},
};

Expand Down

0 comments on commit c4f5568

Please sign in to comment.