Skip to content

Commit 2baa0d7

Browse files
authored
fix(docs): add prominence to font section of engineering guide (#1353)
* fix(docs): add prominence to font section of engineering guide * chore(docs): pr feedback text edits * chore(docs): change font heading
1 parent 18e3442 commit 2baa0d7

File tree

1 file changed

+39
-31
lines changed
  • packages/paste-website/src/pages/getting-started/engineering

1 file changed

+39
-31
lines changed

packages/paste-website/src/pages/getting-started/engineering/index.mdx

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,45 @@ const App = () => (
172172
);
173173
```
174174

175+
### How to Load the Right Font
176+
177+
#### Default theme
178+
179+
Fonts for the default theme are available via the Twilio CDN and published from an [internal git repository](https://code.hq.twilio.com/DSYS/paste-fonts).
180+
181+
The **best and most performant way** to load the fonts is to include the following snippet in the `<head />` of your web page.
182+
183+
```
184+
<link rel="preconnect" href="https://assets.twilio.com" crossorigin />
185+
<link rel="stylesheet" href="https://assets.twilio.com/public_assets/paste-fonts/main-1.2.0/fonts.css">
186+
```
187+
188+
<Callout>
189+
<CalloutText>
190+
We recommend loading the fonts directly from the Twilio CDN. This provides the fastest download time, therefore
191+
giving you the most optimized page load experience.
192+
</CalloutText>
193+
</Callout>
194+
195+
Alternatively, Paste will automatically load the fonts via JavaScript, so long as you wrap your application with the `Theme.Provider`
196+
and select the `default` theme. **Note:** this will result in slower download times than including the fonts in the `<head />`.
197+
198+
#### Other themes
199+
200+
If you are using **any other theme**, Paste leaves it up to you to load the fonts needed. Console uses Whitney ScreenSmart
201+
and SendGrid uses Colfax. More often than not with those themes, you are working within existing SendGrid and Twilio Console applications
202+
and these fonts are automatically loaded for you.
203+
204+
The Whitney font is loaded by the Typography.com service and is only allowed on \*.twilio.com domains as well as localhost.
205+
Make sure to serve your app from the correct hostname if you're having issues with font loading.
206+
207+
If you are not working in an existing Twilio Console experience, you can include the following link element in your sites `head`
208+
to load these fonts if you are serving your application from \*.twilio.com domains.
209+
210+
```
211+
<link rel="stylesheet" type="text/css" href="//cloud.typography.com/6230892/752864/css/fonts.css">
212+
```
213+
175214
## Usage
176215

177216
### Paste Components
@@ -260,37 +299,6 @@ information about `transformIgnorePatterns` can be found by [reading the Jest do
260299
Many apps/websites utilize global stylesheets. Even though Paste styles are scoped at the component level, global styles can creep
261300
in and cause some havoc. Make sure to thoroughly test Paste components to verify everything looks as they should.
262301

263-
### Fonts
264-
265-
#### Default theme
266-
267-
Fonts for the default theme are available via the Twilio CDN and published from an [internal git repository](https://code.hq.twilio.com/DSYS/paste-fonts).
268-
269-
The best and most performant way to load the fonts is to include the following snippet in the `<head />` of your web page.
270-
271-
```
272-
<link rel="preconnect" href="https://assets.twilio.com" crossorigin />
273-
<link rel="stylesheet" href="https://assets.twilio.com/public_assets/paste-fonts/main-1.2.0/fonts.css">
274-
```
275-
276-
Alternatively, Paste will automatically load the fonts via JavaScript, so long as you wrap your application with the `Theme.Provider` and select the `default` theme. Though, you should note that this is not the most performant way.
277-
278-
#### Other themes
279-
280-
If you are using **any other theme**, Paste leaves it up to you to load the fonts needed. Console uses Whitney ScreenSmart
281-
and SendGrid uses Colfax. More often than not with those themes, you are working within existing SendGrid and Twilio Console applications
282-
and these fonts are automatically loaded for you.
283-
284-
The Whitney font is loaded by the Typography.com service and is only allowed on \*.twilio.com domains as well as localhost.
285-
Make sure to serve your app from the correct hostname if you're having issues with font loading.
286-
287-
If you are not working in an existing Twilio Console experience, you can include the following link element in your sites `head`
288-
to load these fonts if you are serving your application from \*.twilio.com domains.
289-
290-
```
291-
<link rel="stylesheet" type="text/css" href="//cloud.typography.com/6230892/752864/css/fonts.css">
292-
```
293-
294302
## Additional information
295303

296304
### Core package list

0 commit comments

Comments
 (0)