Skip to content

Commit 731fb36

Browse files
author
Pierpaolo Wurzburger
committed
fix font-format in typography
1 parent f7759d8 commit 731fb36

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

lib/web/css/source/lib/_typography.less

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,57 @@
2525
}
2626
}
2727

28+
.lib-font-face(
29+
@family-name,
30+
@font-path,
31+
@font-format: false,
32+
@font-weight: normal,
33+
@font-style: normal,
34+
@font-display: auto
35+
) when not (@font-format = false) and (@font-format = 'ttf') {
36+
@font-face {
37+
font-family: @family-name;
38+
src: url('@{font-path}.@{font-format}') format('truetype');
39+
font-weight: @font-weight;
40+
font-style: @font-style;
41+
font-display: @font-display;
42+
}
43+
}
44+
45+
.lib-font-face(
46+
@family-name,
47+
@font-path,
48+
@font-format: false,
49+
@font-weight: normal,
50+
@font-style: normal,
51+
@font-display: auto
52+
) when not (@font-format = false) and (@font-format = 'eot') {
53+
@font-face {
54+
font-family: @family-name;
55+
src: url('@{font-path}.@{font-format}') format('embedded-opentype');
56+
font-weight: @font-weight;
57+
font-style: @font-style;
58+
font-display: @font-display;
59+
}
60+
}
61+
62+
.lib-font-face(
63+
@family-name,
64+
@font-path,
65+
@font-format: false,
66+
@font-weight: normal,
67+
@font-style: normal,
68+
@font-display: auto
69+
) when not (@font-format = false) and (@font-format = 'otf') {
70+
@font-face {
71+
font-family: @family-name;
72+
src: url('@{font-path}.@{font-format}') format('opentype');
73+
font-weight: @font-weight;
74+
font-style: @font-style;
75+
font-display: @font-display;
76+
}
77+
}
78+
2879
.lib-font-face(
2980
@family-name,
3081
@font-path,

0 commit comments

Comments
 (0)