ISSUE-010 - Added TTF and Woff2 format fonts for Formula 1's typeface and updated the Menu bar's fonts to use them.

I incorporated the new fonts through Styled-Components just to be real cool that way.
This commit is contained in:
Kyle Geib committed 2022-01-04 16:33:26 -05:00
1 parent 03321e3cdb
commit 2d3e34b111
16 files changed
+80 -6

No files matched your search

+2 -2
View File
@@ -3,7 +3,7 @@ import { NavLink } from "react-router-dom";
import { InlineCluster } from "@bedrock-layout/inline-cluster";
import useForwardedRef from "@bedrock-layout/use-forwarded-ref";
import { MenuBar, MenuItem } from "./styles";
import { MenuBar, MenuItem, Title } from "./styles";
import f1Logo from "../../public/images/logos/f1-logo-red.svg";
@@ -48,7 +48,7 @@ export const Menu = React.forwardRef<HTMLDivElement, MenuProps>(
return (
<MenuBar ref={innerRef}>
<img src={f1Logo} alt="Formula One logo" height="20px" />
<h3>{props.title}</h3>
<Title>{props.title}</Title>
<nav>
<InlineCluster as="ul" gutter="sm" justify="end">
{newChildren.map((child, i) => (
+6 -1
View File
@@ -2,6 +2,10 @@ import { InlineCluster } from "@bedrock-layout/inline-cluster";
import { PadBox } from "@bedrock-layout/padbox";
import styled, { css } from "styled-components";
export const Title = styled.h3`
font-family: ${p => p.theme.fonts.f1Bold};
`;
export const MenuBar = styled(InlineCluster).attrs(() => ({
as: PadBox,
padding: ["xs", "lg"],
@@ -25,7 +29,8 @@ export const MenuItem = styled(PadBox).attrs(() => ({
> a {
color: ${p => p.theme.colors.darkGrey};
text-decoration: none;
font-weight: 900;
font-family: ${p => p.theme.fonts.f1Regular};
font-size: 0.8em;
}
${({ active }) => active && css`
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+60
View File
@@ -0,0 +1,60 @@
import { createGlobalStyle } from "styled-components";
import Formula1RegularWoff2 from "./Formula1-Regular.woff2";
import Formula1RegularTTF from "./Formula1-Regular.ttf";
import Formula1BoldWoff2 from "./Formula1-Bold.woff2";
import Formula1BoldTTF from "./Formula1-Bold.ttf";
import Formula1ItalicWoff2 from "./Formula1-Italic.woff2";
import Formula1ItalicTTF from "./Formula1-Italic.ttf";
import Formula1BlackWoff2 from "./Formula1-Black.woff2";
import Formula1BlackTTF from "./Formula1-Black.ttf";
import Formula1WideWoff2 from "./Formula1-Wide.woff2";
import Formula1WideTTF from "./Formula1-Wide.ttf";
export default createGlobalStyle`
@font-face {
font-family: "Formula1 Regular";
src: url(${Formula1RegularWoff2}) format("woff2"),
url(${Formula1RegularTTF}) format("truetype");
font-weight: normal;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Formula1 Bold";
src: url(${Formula1BoldWoff2}) format("woff2"),
url(${Formula1BoldTTF}) format("truetype");
font-weight: bold;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Formula1 Italic";
src: url(${Formula1ItalicWoff2}) format("woff2"),
url(${Formula1ItalicTTF}) format("truetype");
font-weight: normal;
font-style: italic;
font-display: swap;
}
@font-face {
font-family: "Formula1 Black";
src: url(${Formula1BlackWoff2}) format("woff2"),
url(${Formula1BlackTTF}) format("truetype");
font-weight: 900;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Formula1 Wide";
src: url(${Formula1WideWoff2}) format("woff2"),
url(${Formula1WideTTF}) format("truetype");
font-weight: 500;
font-style: normal;
font-stretch: expanded;
font-display: swap;
}
`;
+2
View File
@@ -8,11 +8,13 @@ import "./clear.css";
import App from "./App";
import Broadcast from "./routes/BroadcastRoute";
import { GlobalStyle, theme } from "./shared/theme";
import GlobalFonts from "./fonts/fonts";
ReactDOM.render(
<React.StrictMode>
<ThemeProvider theme={theme}>
<GlobalStyle theme={theme} />
<GlobalFonts />
<BrowserRouter>
<Routes>
<Route path="/" element={<App />} />
+8 -3
View File
@@ -3,7 +3,12 @@ import { createGlobalStyle, ThemeProps } from "styled-components";
export const theme = {
fonts: {
basic: "Helvetica, sans-serif",
accent: "\"Permanent Marker\", cursive",
f1: "Formula1, sans-serif",
f1Regular: "\"Formula1 Regular\", sans-serif",
f1Bold: "\"Formula1 Bold\", sans-serif",
f1Italic: "\"Formula1 Italic\", sans-serif",
f1Black: "\"Formula1 Black\", sans-serif",
f1Wide: "\"Formula1 Wide\", sans-serif",
},
colors: {
orange: "#f4ae40",
@@ -20,7 +25,7 @@ export type MainThemeProps = ThemeProps<typeof theme>;
export const GlobalStyle = createGlobalStyle<MainThemeProps>`
body {
margin: 0;
font-family: ${({ theme }) => theme.fonts.basic};
font-family: ${p => p.theme.fonts.basic};
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@@ -34,7 +39,7 @@ export const GlobalStyle = createGlobalStyle<MainThemeProps>`
input,
textarea,
button {
font-family: ${({ theme }) => theme.fonts.basic};
font-family: ${p => p.theme.fonts.basic};
}
.main {
+2
View File
@@ -0,0 +1,2 @@
declare module "*.woff2";
declare module "*.ttf";