You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -63,6 +90,50 @@ Add the following snippet to `gatsby-config.js` plugins array.
63
90
}
64
91
```
65
92
93
+
## Options
94
+
95
+
<table>
96
+
<thead>
97
+
<tr>
98
+
<th>Option</th>
99
+
<th>Description</th>
100
+
<th>Default</th>
101
+
</tr>
102
+
</thead>
103
+
<tbody>
104
+
<tr>
105
+
<td>enableListener</td>
106
+
<td>Enable font loading listener to handle Flash Of Unstyled Text. If enabled, CSS classes will be applied to HTML once each font has finished loading.</td>
107
+
<td>false</td>
108
+
</tr>
109
+
<tr>
110
+
<td>preconnect</td>
111
+
<td>URLs used for preconnect meta. Base URL where <strong>font files</strong> are hosted.</td>
112
+
<td>[]</td>
113
+
</tr>
114
+
<tr>
115
+
<td>interval</td>
116
+
<td>Font listener interval (in ms). Default is 300ms. Recommended: >=300ms. </td>
117
+
<td>300</td>
118
+
</tr>
119
+
<tr>
120
+
<td>timeout</td>
121
+
<td>Font listener timeout value (in ms). Default is 30s (30000ms). Listener will no longer check for loaded fonts after timeout, fonts will still be loaded and displayed, but without handling FOUT.</td>
122
+
<td>30000</td>
123
+
</tr>
124
+
<tr>
125
+
<td>web</td>
126
+
<td>Self-hosted fonts config. Add font files and font CSS files to "static" folder. Array of <code>{name: "Font name", file: "https://url-to-font-css.path"}</code> objects.</td>
127
+
<td>[]</td>
128
+
</tr>
129
+
<tr>
130
+
<td>custom</td>
131
+
<td>Web fonts config. File link should point to font CSS file. Array of <code>{name: "Font name", file: "https://url-to-font-css.path"}</code> objects.</td>
132
+
<td>[]</td>
133
+
</tr>
134
+
<tbody>
135
+
</table>
136
+
66
137
## Handling FOUT with Font loading listener
67
138
68
139
When loading fonts asynchronously, Flash Of Unstyled Text (FOUT) might happen because fonts load few moments later after page is displayed to the user.
@@ -83,7 +154,6 @@ Here is the example of how `body` element will look like after all fonts are bei
Feel free to [report issues](https://github.com/codeAdrian/gatsby-omni-font-loader/issues) you find and feel free to contribute to the project by creating Pull Requests.
@@ -94,4 +164,4 @@ Contributions are welcome and appreciated!
94
164
95
165
The project is created and maintained by [Adrian Bece](https://codeadrian.github.io/) with the generous help of community contributors. If you have used the plugin and would like to contribute, feel free to [Buy Me A Coffee](https://www.buymeacoffee.com/ubnZ8GgDJ).
96
166
97
-
<ahref="https://www.buymeacoffee.com/ubnZ8GgDJ"target="_blank"><imgsrc="https://cdn.buymeacoffee.com/buttons/default-red.png"alt="Buy Me A Coffee"style="height: 51px!important;width: 217px!important;"></a>
167
+
<ahref="https://www.buymeacoffee.com/ubnZ8GgDJ"><imgsrc="https://img.buymeacoffee.com/button-api/?text=Support this project&emoji=&slug=ubnZ8GgDJ&button_colour=BD5FFF&font_colour=ffffff&font_family=Bree&outline_colour=000000&coffee_colour=FFDD00"></a>
0 commit comments