Skip to content

Commit 1aefd05

Browse files
committed
preload fonts and switch display to stop flicker on load
1 parent f5826e7 commit 1aefd05

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

docusaurus.config.ts

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,48 @@ const config: Config = {
157157
],
158158
],
159159

160+
headTags: [
161+
{
162+
tagName: 'link',
163+
attributes: {
164+
rel: 'preload',
165+
href: 'https://d1a3f4spazzrp4.cloudfront.net/dotcom-assets/fonts/UberMove-Bold.woff2',
166+
as: 'font',
167+
type: 'font/woff2',
168+
crossorigin: 'anonymous',
169+
},
170+
},
171+
{
172+
tagName: 'link',
173+
attributes: {
174+
rel: 'preload',
175+
href: 'https://d1a3f4spazzrp4.cloudfront.net/dotcom-assets/fonts/UberMoveText-Regular.woff2',
176+
as: 'font',
177+
type: 'font/woff2',
178+
crossorigin: 'anonymous',
179+
},
180+
},
181+
{
182+
tagName: 'link',
183+
attributes: {
184+
rel: 'preload',
185+
href: 'https://d1a3f4spazzrp4.cloudfront.net/dotcom-assets/fonts/UberMoveText-Medium.woff2',
186+
as: 'font',
187+
type: 'font/woff2',
188+
crossorigin: 'anonymous',
189+
},
190+
},
191+
{
192+
tagName: 'link',
193+
attributes: {
194+
rel: 'preload',
195+
href: 'https://d1a3f4spazzrp4.cloudfront.net/dotcom-assets/fonts/UberMoveText-Bold.woff2',
196+
as: 'font',
197+
type: 'font/woff2',
198+
crossorigin: 'anonymous',
199+
},
200+
},
201+
],
160202
themeConfig: {
161203
announcementBar: {
162204
id: 'survey_announcement',
@@ -206,7 +248,9 @@ const config: Config = {
206248
logo: {
207249
alt: 'Cadence Logo',
208250
src: 'img/cadence-logo.svg',
209-
srcDark: "img/logo-white.svg"
251+
srcDark: "img/logo-white.svg",
252+
width: 82,
253+
height: 32,
210254
},
211255
items: [
212256
{

src/css/fonts.css

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)