We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cc977af + 19cb924 commit 6e9a9f0Copy full SHA for 6e9a9f0
utils/fontListener.ts
@@ -11,8 +11,10 @@ export const fontListener = ({ fontNames, scope }) => {
11
addClassName("all");
12
}
13
14
- function handleFontLoad(fontName: string) {
15
- addClassName(fontName);
+ function handleFontLoad(fontFaces: FontFace[]) {
+ fontFaces.forEach((fontFace) => {
16
+ addClassName(fontFace.family);
17
+ })
18
19
20
function fontMapper(fontName) {
@@ -37,7 +39,7 @@ export const fontListener = ({ fontNames, scope }) => {
37
39
errorFallback();
38
40
41
- function addClassName(fontName) {
42
+ function addClassName(fontName: string) {
43
document[targetElement].classList.add(`wf-${kebabCase(fontName)}`);
44
45
0 commit comments