Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply ZK85Icons to all themes and integrate all fa6's font-family into one: 'FontAwesome' #3047

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 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,6 +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;
}

21 changes: 21 additions & 0 deletions zul/src/main/resources/web/zul/less/font/_font-order.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// ZK85Icons & support FontAwesome 4 syntax
[class*="@{fa-css-prefix}-"] {
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");');
}
19 changes: 14 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.

24 changes: 0 additions & 24 deletions zul/src/main/resources/web/zul/less/norm.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,6 @@ e('</c:if>');
.applyCSS3('box-sizing', 'border-box');
}

// Set icons class
// ZK85Icons & support FontAwesome 4 syntax
[class*="@{fa-css-prefix}-"] {
font-family: ZK85Icons, "Font Awesome 6 Free", "Font Awesome 6 Brands"; // Default theme uses some override font
}
// 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";
}

// To support specific ZK85Icons's icons, these unicodes are abandoned in fa6
.@{fa-css-prefix}-circle-o:before { content: "\f10c"; }
.@{fa-css-prefix}-envelope-o:before { content: "\f003"; }
.@{fa-css-prefix}-flag-o:before { content: "\f11d"; }
.@{fa-css-prefix}-question-circle-o:before { content: "\f29c"; }
.@{fa-css-prefix}-times-circle-o:before { content: "\f05c"; }
.@{fa-css-prefix}-user-o:before { content: "\f2c0"; }

// Reset
@{browserDefaultPrefix}input[type=number]::-webkit-inner-spin-button,
@{browserDefaultPrefix}input[type=number]::-webkit-outer-spin-button {
Expand Down