Skip to content

Commit 9e48f91

Browse files
Tu Nguyenmrtuvn
Tu Nguyen
authored andcommitted
Allow specify font type when declare custom font
1 parent fa211bd commit 9e48f91

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
@font-format: false,
1414
@font-weight: normal,
1515
@font-style: normal,
16-
@font-display: auto
16+
@font-display: auto,
17+
@font-type: false
1718
) when (@font-format = false) {
1819
@font-face {
1920
font-family: @family-name;
@@ -25,17 +26,23 @@
2526
}
2627
}
2728

29+
// When need specify font format also should define font type include
30+
// The available types for @font-type are 'woff', 'woff2', 'truetype', 'opentype', 'embedded-opentype', and 'svg'
31+
// Enclose it in single quotes
32+
// _____________________________________________
33+
2834
.lib-font-face(
2935
@family-name,
3036
@font-path,
3137
@font-format: false,
3238
@font-weight: normal,
3339
@font-style: normal,
34-
@font-display: auto
35-
) when not (@font-format = false) {
40+
@font-display: auto,
41+
@font-type: false
42+
) when not (@font-format = false) and not (@font-type = false) {
3643
@font-face {
3744
font-family: @family-name;
38-
src: url('@{font-path}.@{font-format}') format(@font-format);
45+
src: url('@{font-path}.@{font-format}') format(@font-type);
3946
font-weight: @font-weight;
4047
font-style: @font-style;
4148
font-display: @font-display;
@@ -569,3 +576,4 @@
569576
.lib-typography-code();
570577
.lib-typography-blockquote();
571578
}
579+

0 commit comments

Comments
 (0)