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

Revert "fix(font): use gatsby for static file hosting" #1283

Merged
merged 1 commit into from
Nov 21, 2022
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
4 changes: 4 additions & 0 deletions .nowignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
public/
.cache/
.npmrc
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 0 additions & 12 deletions packages/example/static/fonts/subset.sh

This file was deleted.

4 changes: 2 additions & 2 deletions packages/gatsby-theme-carbon/gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export const onRenderBody = ({ setHeadComponents, setBodyAttributes }) => {
<link
key="sans"
rel="preload"
href="/fonts/IBMPlexSansLatin-VF.woff2"
href="https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansLatin-VF.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
crossOrigin=""
/>,
<script
key="scroll-loader-script"
Expand Down
50 changes: 33 additions & 17 deletions packages/gatsby-theme-carbon/src/styles/internal/_plex.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
font-family: 'IBM Plex Sans VF';
unicode-range: U+0020-00FF;
font-display: swap;
src: url('/fonts/IBMPlexSansLatin-VF.woff2') format('woff2-variations'),
url('/fonts/IBMPlexSansLatin-VF.woff2') format('woff2');
src: url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansLatin-VF.woff2')
format('woff2-variations'),
url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansLatin-VF.woff2')
format('woff2');
font-weight: 100 900;
font-style: normal;
}
Expand All @@ -17,8 +19,10 @@
font-family: 'IBM Plex Sans VF';
unicode-range: U+0100-1EF9;
font-display: swap;
src: url('/fonts/IBMPlexSansLatinExt-VF.woff2') format('woff2-variations'),
url('/fonts/IBMPlexSansLatinExt-VF.woff2') format('woff2');
src: url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansLatinExt-VF.woff2')
format('woff2-variations'),
url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansLatinExt-VF.woff2')
format('woff2');
font-weight: 100 900;
font-style: normal;
}
Expand All @@ -27,8 +31,10 @@
font-family: 'IBM Plex Sans VF';
unicode-range: U+2000-FB02;
font-display: swap;
src: url('/fonts/IBMPlexSansOther-VF.woff2') format('woff2-variations'),
url('/fonts/IBMPlexSansOther-VF.woff2') format('woff2');
src: url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansOther-VF.woff2')
format('woff2-variations'),
url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansOther-VF.woff2')
format('woff2');
font-weight: 100 900;
font-style: normal;
}
Expand All @@ -38,8 +44,10 @@
font-family: 'IBM Plex Sans VF';
unicode-range: U+0020-00FF;
font-display: swap;
src: url('/fonts/IBMPlexSansLatin-Italic-VF.woff2') format('woff2-variations'),
url('/fonts/IBMPlexSansLatin-Italic-VF.woff2') format('woff2');
src: url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansLatin-Italic-VF.woff2')
format('woff2-variations'),
url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansLatin-Italic-VF.woff2')
format('woff2');
font-weight: 100 900;
font-style: italic;
}
Expand All @@ -48,9 +56,10 @@
font-family: 'IBM Plex Sans VF';
unicode-range: U+0100-1EF9;
font-display: swap;
src: url('/fonts/IBMPlexSansLatinExt-Italic-VF.woff2')
src: url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansLatinExt-Italic-VF.woff2')
format('woff2-variations'),
url('/fonts/IBMPlexSansLatinExt-Italic-VF.woff2') format('woff2');
url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansLatinExt-Italic-VF.woff2')
format('woff2');
font-weight: 100 900;
font-style: italic;
}
Expand All @@ -59,8 +68,10 @@
font-family: 'IBM Plex Sans VF';
unicode-range: U+2000-FB02;
font-display: swap;
src: url('/fonts/IBMPlexSansOther-Italic-VF.woff2') format('woff2-variations'),
url('/fonts/IBMPlexSansOther-Italic-VF.woff2') format('woff2');
src: url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansOther-Italic-VF.woff2')
format('woff2-variations'),
url('https://gatsby.carbondesignsystem.com/fonts/IBMPlexSansOther-Italic-VF.woff2')
format('woff2');
font-weight: 100 900;
font-style: italic;
}
Expand All @@ -71,7 +82,8 @@
font-style: normal;
font-weight: 400;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url('/fonts/mono/IBMPlexMono-Regular-Latin1.woff2') format('woff2');
url('https://gatsby.carbondesignsystem.com/fonts/mono/IBMPlexMono-Regular-Latin1.woff2')
format('woff2');
unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00A3, U+00A4-00FF, U+0131,
U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E,
U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122,
Expand All @@ -83,7 +95,8 @@
font-style: normal;
font-weight: 400;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url('/fonts/mono/IBMPlexMono-Regular-Latin2.woff2') format('woff2');
url('https://gatsby.carbondesignsystem.com/fonts/mono/IBMPlexMono-Regular-Latin2.woff2')
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF,
U+2C60-2C7F, U+A720-A7FF, U+FB01-FB02;
}
Expand All @@ -93,7 +106,8 @@
font-style: normal;
font-weight: 400;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url('/fonts/mono/IBMPlexMono-Regular-Latin3.woff2') format('woff2');
url('https://gatsby.carbondesignsystem.com/fonts/mono/IBMPlexMono-Regular-Latin3.woff2')
format('woff2');
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
}

Expand All @@ -102,7 +116,8 @@
font-style: normal;
font-weight: 400;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url('/fonts/mono/IBMPlexMono-Regular-Pi.woff2') format('woff2');
url('https://gatsby.carbondesignsystem.com/fonts/mono/IBMPlexMono-Regular-Pi.woff2')
format('woff2');
unicode-range: U+0E3F, U+2032-2033, U+2070, U+2075-2079, U+2080-2081, U+2083,
U+2085-2089, U+2113, U+2116, U+2126, U+212E, U+2150-2151, U+2153-215E,
U+2190-2199, U+21A9-21AA, U+21B0-21B3, U+21B6-21B7, U+21BA-21BB, U+21C4,
Expand All @@ -116,7 +131,8 @@
font-style: normal;
font-weight: 400;
src: local('IBM Plex Mono'), local('IBMPlexMono'),
url('/fonts/mono/IBMPlexMono-Regular-Cyrillic.woff2') format('woff2');
url('https://gatsby.carbondesignsystem.com/fonts/mono/IBMPlexMono-Regular-Cyrillic.woff2')
format('woff2');
unicode-range: U+0400-045F, U+0472-0473, U+0490-049D, U+04A0-04A5, U+04AA-04AB,
U+04AE-04B3, U+04B6-04BB, U+04C0-04C2, U+04CF-04D9, U+04DC-04DF, U+04E2-04E9,
U+04EE-04F5, U+04F8-04F9;
Expand Down
19 changes: 19 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": 2,
"name": "gatsby-theme-carbon",
"alias": "gatsby-theme-carbon",
"public": true,
"builds": [
{
"src": "package.json",
"use": "@vercel/static-build",
"config": {
"distDir": "packages/example/public"
}
},
{
"src": "fonts/**/*.{woff2,ttf}",
"use": "@now/static"
}
]
}