Merge pull request #14 from TiE23/ISSUE-010

ISSUE-010 - Added TTF and Woff2 format fonts for Formula 1's typeface…
This commit is contained in:
Kyle Geib authored and GitHub committed 2022-01-04 16:34:28 -05:00
commit 12c05ce865
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 { InlineCluster } from "@bedrock-layout/inline-cluster";
import useForwardedRef from "@bedrock-layout/use-forwarded-ref"; 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"; import f1Logo from "../../public/images/logos/f1-logo-red.svg";
@@ -48,7 +48,7 @@ export const Menu = React.forwardRef<HTMLDivElement, MenuProps>(
return ( return (
<MenuBar ref={innerRef}> <MenuBar ref={innerRef}>
<img src={f1Logo} alt="Formula One logo" height="20px" /> <img src={f1Logo} alt="Formula One logo" height="20px" />
<h3>{props.title}</h3> <Title>{props.title}</Title>
<nav> <nav>
<InlineCluster as="ul" gutter="sm" justify="end"> <InlineCluster as="ul" gutter="sm" justify="end">
{newChildren.map((child, i) => ( {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 { PadBox } from "@bedrock-layout/padbox";
import styled, { css } from "styled-components"; import styled, { css } from "styled-components";
export const Title = styled.h3`
font-family: ${p => p.theme.fonts.f1Bold};
`;
export const MenuBar = styled(InlineCluster).attrs(() => ({ export const MenuBar = styled(InlineCluster).attrs(() => ({
as: PadBox, as: PadBox,
padding: ["xs", "lg"], padding: ["xs", "lg"],
@@ -25,7 +29,8 @@ export const MenuItem = styled(PadBox).attrs(() => ({
> a { > a {
color: ${p => p.theme.colors.darkGrey}; color: ${p => p.theme.colors.darkGrey};
text-decoration: none; text-decoration: none;
font-weight: 900; font-family: ${p => p.theme.fonts.f1Regular};
font-size: 0.8em;
} }
${({ active }) => active && css` ${({ 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 App from "./App";
import Broadcast from "./routes/BroadcastRoute"; import Broadcast from "./routes/BroadcastRoute";
import { GlobalStyle, theme } from "./shared/theme"; import { GlobalStyle, theme } from "./shared/theme";
import GlobalFonts from "./fonts/fonts";
ReactDOM.render( ReactDOM.render(
<React.StrictMode> <React.StrictMode>
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<GlobalStyle theme={theme} /> <GlobalStyle theme={theme} />
<GlobalFonts />
<BrowserRouter> <BrowserRouter>
<Routes> <Routes>
<Route path="/" element={<App />} /> <Route path="/" element={<App />} />
+8 -3
View File
@@ -3,7 +3,12 @@ import { createGlobalStyle, ThemeProps } from "styled-components";
export const theme = { export const theme = {
fonts: { fonts: {
basic: "Helvetica, sans-serif", 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: { colors: {
orange: "#f4ae40", orange: "#f4ae40",
@@ -20,7 +25,7 @@ export type MainThemeProps = ThemeProps<typeof theme>;
export const GlobalStyle = createGlobalStyle<MainThemeProps>` export const GlobalStyle = createGlobalStyle<MainThemeProps>`
body { body {
margin: 0; margin: 0;
font-family: ${({ theme }) => theme.fonts.basic}; font-family: ${p => p.theme.fonts.basic};
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
@@ -34,7 +39,7 @@ export const GlobalStyle = createGlobalStyle<MainThemeProps>`
input, input,
textarea, textarea,
button { button {
font-family: ${({ theme }) => theme.fonts.basic}; font-family: ${p => p.theme.fonts.basic};
} }
.main { .main {
+2
View File
@@ -0,0 +1,2 @@
declare module "*.woff2";
declare module "*.ttf";