Skip to content

Commit

Permalink
perf(website): use jsdelivr cdn instead of r2 origin for css (#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuhito committed Dec 10, 2023
1 parent 8256f7c commit ab71aeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions website/app/components/preview/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ const TextArea = ({ metadata, variableCssKey }: TextAreaProps) => {
<Fragment key={`s-${weight}`}>
<link
rel="stylesheet"
href={`https://r2.fontsource.org/css/${id}@latest/${weight}.css`}
href={`https://cdn.jsdelivr.net/fontsource/css/${id}@latest/${weight}.css`}
/>
<TextBox weight={weight} family={family} loaded={!isFontLoaded} />
</Fragment>
))}
{isVariable && (
<link
rel="stylesheet"
href={`https://r2.fontsource.org/css/${id}:vf@latest/${
href={`https://cdn.jsdelivr.net/fontsource/css/${id}:vf@latest/${
variableCssKey ?? 'wght'
}.css`}
/>
Expand Down
2 changes: 1 addition & 1 deletion website/app/components/search/Hits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const HitComponent = ({ hit, fontSize }: HitComponentProps) => {
>
<link
rel="stylesheet"
href={`https://r2.fontsource.org/css/${hit.objectID}@latest/index.css`}
href={`https://cdn.jsdelivr.net/fontsource/css/${hit.objectID}@latest/index.css`}
/>
<Skeleton visible={!isFontLoaded}>
<Text fz={fontSize} style={{ fontFamily: `"${hit.family}"` }}>
Expand Down

0 comments on commit ab71aeb

Please sign in to comment.