Skip to content

Commit

Permalink
preload fonts and switch display to stop flicker on load (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibarrajo authored Jan 27, 2025
1 parent f5826e7 commit 46086f9
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
46 changes: 45 additions & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,48 @@ const config: Config = {
],
],

headTags: [
{
tagName: 'link',
attributes: {
rel: 'preload',
href: 'https://d1a3f4spazzrp4.cloudfront.net/dotcom-assets/fonts/UberMove-Bold.woff2',
as: 'font',
type: 'font/woff2',
crossorigin: 'anonymous',
},
},
{
tagName: 'link',
attributes: {
rel: 'preload',
href: 'https://d1a3f4spazzrp4.cloudfront.net/dotcom-assets/fonts/UberMoveText-Regular.woff2',
as: 'font',
type: 'font/woff2',
crossorigin: 'anonymous',
},
},
{
tagName: 'link',
attributes: {
rel: 'preload',
href: 'https://d1a3f4spazzrp4.cloudfront.net/dotcom-assets/fonts/UberMoveText-Medium.woff2',
as: 'font',
type: 'font/woff2',
crossorigin: 'anonymous',
},
},
{
tagName: 'link',
attributes: {
rel: 'preload',
href: 'https://d1a3f4spazzrp4.cloudfront.net/dotcom-assets/fonts/UberMoveText-Bold.woff2',
as: 'font',
type: 'font/woff2',
crossorigin: 'anonymous',
},
},
],
themeConfig: {
announcementBar: {
id: 'survey_announcement',
Expand Down Expand Up @@ -206,7 +248,9 @@ const config: Config = {
logo: {
alt: 'Cadence Logo',
src: 'img/cadence-logo.svg',
srcDark: "img/logo-white.svg"
srcDark: "img/logo-white.svg",
width: 82,
height: 32,
},
items: [
{
Expand Down
8 changes: 4 additions & 4 deletions src/css/fonts.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 46086f9

Please sign in to comment.