Skip to content

Commit

Permalink
Integrate all fa6's font-familys into one: 'FontAwesome'
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsonChan committed Sep 11, 2023
1 parent dc904e9 commit f545858
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 114 deletions.
3 changes: 0 additions & 3 deletions zul/src/main/resources/web/zul/font/font-awesome.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>');
@import "~./zul/less/font/_icons.less";
@import "~./zul/less/font/_screen-reader.less";
@import "~./zul/less/font/_shims.less";
@import "~./zul/less/font/brands.less";
@import "~./zul/less/font/regular.less";
@import "~./zul/less/font/solid.less";
@import "~./zul/less/font/_font-order.less";
2 changes: 1 addition & 1 deletion zul/src/main/resources/web/zul/less/_zkmixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
// icon font utility
.baseIconFont() {
display: inline-block;
font-family: ZK85Icons, "Font Awesome 6 Free", "Font Awesome 6 Brands";
font-family: ZK85Icons, FontAwesome;
font-style: normal;
font-weight: normal;
font-size: inherit;
Expand Down
8 changes: 2 additions & 6 deletions zul/src/main/resources/web/zul/less/font/_core.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@
.@{fa-css-prefix}-classic,
.@{fa-css-prefix}-solid,
.far,
.@{fa-css-prefix}-regular {
font-family: 'Font Awesome 6 Free';
}

.@{fa-css-prefix}-regular,
.fab,
.@{fa-css-prefix}-brands {
font-family: 'Font Awesome 6 Brands';
font-family: FontAwesome;
}

31 changes: 19 additions & 12 deletions zul/src/main/resources/web/zul/less/font/_font-order.less
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
// ZK85Icons & support FontAwesome 4 syntax
[class*="@{fa-css-prefix}-"] {
font-family: ZK85Icons, "Font Awesome 6 Free", "Font Awesome 6 Brands";
}
// FontAwesome 6 solid & regular syntax
[class*="@{fa-css-prefix}-classic"],
[class*="@{fa-css-prefix}-solid"],
[class*="@{fa-css-prefix}-regular"] {
font-family: "Font Awesome 6 Free";
}
// FontAwesome 6 brands syntax
[class*="@{fa-css-prefix}-brands"] {
font-family: "Font Awesome 6 Brands";
}
font-family: ZK85Icons, FontAwesome;
}

// Font Awesome 6 syntax
.fas,
.@{fa-css-prefix}-solid {
font-family: FontAwesome;
font-weight: 900;
}
.far,
.@{fa-css-prefix}-regular {
font-family: FontAwesome;
font-weight: 400;
}
.fab,
.@{fa-css-prefix}-brands {
font-family: FontAwesome;
font-weight: 400;
}
4 changes: 4 additions & 0 deletions zul/src/main/resources/web/zul/less/font/_icons.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
each(.fa-icons(), {
.@{fa-css-prefix}-@{key}::before { content: @value; }
});

each(.fa-brand-icons(), {
.@{fa-css-prefix}-@{key}:before { content: @value; }
});
2 changes: 1 addition & 1 deletion zul/src/main/resources/web/zul/less/font/_mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

// sets a specific icon family to use alongside style + icon mixins
.fa-family-classic() {
font-family: 'Font Awesome 6 Free';
font-family: FontAwesome;
}

// convenience mixins for declaring pseudo-elements by CSS variable,
Expand Down
41 changes: 40 additions & 1 deletion zul/src/main/resources/web/zul/less/font/_path.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,43 @@
url(${c:encodeURL("~./zul/less/font/ZK85Icons.svg?v=4.7.0#ZK85Icons")}) format("svg");');
font-weight: normal;
font-style: normal;
}
}

/*!
* Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2023 Fonticons, Inc.
*/

// solid.less
@font-face {
font-family: 'FontAwesome';
font-style: normal;
font-weight: 900;
font-display: @fa-font-display;
e('src: url(${c:encodeURL("@{fa-font-path}/fa-solid-900.woff2")}) format("woff2"),
url(${c:encodeURL("@{fa-font-path}/fa-solid-900.ttf")}) format("truetype"),
url(${c:encodeURL("@{fa-font-path}/solid.svg")}) format("svg");');
}

// regular.less
@font-face {
font-family: 'FontAwesome';
font-style: normal;
font-weight: 400;
font-display: @fa-font-display;
e('src: url(${c:encodeURL("@{fa-font-path}/fa-regular-400.woff2")}) format("woff2"),
url(${c:encodeURL("@{fa-font-path}/fa-regular-400.ttf")}) format("truetype"),
url(${c:encodeURL("@{fa-font-path}/regular.svg")}) format("svg");');
}

// brands.less
@font-face {
font-family: 'FontAwesome';
font-style: normal;
font-weight: 400;
font-display: @fa-font-display;
e('src: url(${c:encodeURL("@{fa-font-path}/fa-brands-400.woff2")}) format("woff2"),
url(${c:encodeURL("@{fa-font-path}/fa-brands-400.ttf")}) format("truetype"),
url(${c:encodeURL("@{fa-font-path}/brands.svg")}) format("svg");');
}
10 changes: 5 additions & 5 deletions zul/src/main/resources/web/zul/less/font/_shims.less

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions zul/src/main/resources/web/zul/less/font/_variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

@fa-css-prefix : z-icon;
@fa-style : 900;
@fa-style-family : "Font Awesome 6 Free";
@fa-style-family-sharp : "Font Awesome 6 Sharp";
@fa-style-family : 'FontAwesome';

@fa-display : inline-block;

Expand Down
30 changes: 0 additions & 30 deletions zul/src/main/resources/web/zul/less/font/brands.less

This file was deleted.

26 changes: 0 additions & 26 deletions zul/src/main/resources/web/zul/less/font/regular.less

This file was deleted.

27 changes: 0 additions & 27 deletions zul/src/main/resources/web/zul/less/font/solid.less

This file was deleted.

0 comments on commit f545858

Please sign in to comment.