Skip to content

Commit ffa3108

Browse files
authored
Upgrade font awesome to version 6 (#40524)
* Upgrade font awesome to version 6 * shim
1 parent 25ef885 commit ffa3108

File tree

14 files changed

+33
-37
lines changed

14 files changed

+33
-37
lines changed

build/build-modules-js/init/patches.es6.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,10 @@ document.addEventListener("joomla:updated", (event) => [].slice.call(event.targe
3434
`);
3535
await writeFile(shortandsweetPath, ShortandsweetJs, { encoding: 'utf8', mode: 0o644 });
3636

37-
// Patch the Font Awesome math.div sass deprecations
38-
// _larger.scss
39-
let faPath = join(mediaVendorPath, 'fontawesome-free/scss/_larger.scss');
40-
let newScss = (await readFile(faPath, { encoding: 'utf8' })).replace('(4em / 3)', '(4em * .333)').replace('(3em / 4)', '(3em * .25)');
41-
await writeFile(faPath, newScss, { encoding: 'utf8', mode: 0o644 });
42-
await writeFile(join(RootPath, 'node_modules/@fortawesome/fontawesome-free/scss/_larger.scss'), newScss, { encoding: 'utf8', mode: 0o644 });
43-
// _list.scss
44-
faPath = join(mediaVendorPath, 'fontawesome-free/scss/_list.scss');
45-
newScss = (await readFile(faPath, { encoding: 'utf8' })).replace('5/4', '1.25');
46-
await writeFile(faPath, newScss, { encoding: 'utf8', mode: 0o644 });
47-
await writeFile(join(RootPath, 'node_modules/@fortawesome/fontawesome-free/scss/_list.scss'), newScss, { encoding: 'utf8', mode: 0o644 });
48-
// _variables.scss
49-
faPath = join(mediaVendorPath, 'fontawesome-free/scss/_variables.scss');
50-
newScss = (await readFile(faPath, { encoding: 'utf8' })).replace('(20em / 16)', '(20em * .0625)');
37+
// Include the v5 shim for Font Awesome
38+
const faPath = join(mediaVendorPath, 'fontawesome-free/scss/fontawesome.scss');
39+
const newScss = (await readFile(faPath, { encoding: 'utf8' })).concat(`
40+
@import 'shims';
41+
`);
5142
await writeFile(faPath, newScss, { encoding: 'utf8', mode: 0o644 });
52-
await writeFile(join(RootPath, 'node_modules/@fortawesome/fontawesome-free/scss/_variables.scss'), newScss, { encoding: 'utf8', mode: 0o644 });
5343
};

build/media_source/com_media/scss/components/_media-browser.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
left: 0;
8989
width: calc(#{$grid-item-icon-size} * 1.3);
9090
height: calc(#{$grid-item-icon-size} * 1.3);
91-
font-family: "Font Awesome 5 Free";
91+
font-family: "Font Awesome 6 Free";
9292
font-size: $grid-item-icon-size;
9393
font-weight: 900;
9494
line-height: calc(#{$grid-item-icon-size} * 1.3);
@@ -354,7 +354,7 @@
354354
transition: all .2s cubic-bezier(.4, 0, .2, 1);
355355
}
356356
&::before {
357-
font-family: "Font Awesome 5 Free";
357+
font-family: "Font Awesome 6 Free";
358358
color: $table-item-icon-color;
359359
.selected & {
360360
color: $table-item-icon-color-selected;

build/media_source/plg_system_debug/widgets/languageStrings/widget.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash {
4444

4545
table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye:before,
4646
table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash:before {
47-
font-family:"Font Awesome 5 Free";
47+
font-family:"Font Awesome 6 Free";
4848
margin-right: 4px;
4949
/*font-size: 12px;*/
5050
}

build/media_source/plg_system_debug/widgets/sqlqueries/widget.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-eye:before,
4949
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-eye-dash:before,
5050
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before,
5151
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:before {
52-
font-family: "Font Awesome 5 Free";
52+
font-family: "Font Awesome 6 Free";
5353
margin-right: 4px;
5454
font-size: 12px;
5555
font-weight: 900;

build/media_source/system/scss/joomla-fontawesome.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
$fa-font-path: "../../../media/vendor/fontawesome-free/webfonts" !default;
33
$fa-font-display: block !default;
44

5-
// Font Awesome 5 Free
5+
// Font Awesome 6 Free
66
@import "../../../../media/vendor/fontawesome-free/scss/fontawesome";
77
@import "../../../../media/vendor/fontawesome-free/scss/regular";
88
@import "../../../../media/vendor/fontawesome-free/scss/solid";

build/media_source/templates/administrator/atum/scss/blocks/_global.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ body:not(.contentpane) .main-card {
178178
// external links with icons
179179
a[target="_blank"]::before {
180180
padding-inline-end: 3px;
181-
font-family: "Font Awesome 5 Free";
181+
font-family: "Font Awesome 6 Free";
182182
font-size: 14px;
183183
font-weight: 900;
184184
content: "\f35d";

build/media_source/templates/administrator/atum/scss/blocks/_sidebar-nav.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
&::before {
2222
margin-inline-end: .5rem;
23-
font-family: "Font Awesome 5 Free";
23+
font-family: "Font Awesome 6 Free";
2424
font-weight: 900;
2525
content: "\f054" #{"/*!rtl:\"\f053\"*/"};
2626
}

build/media_source/templates/administrator/atum/scss/blocks/_sidebar.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
align-items: center;
142142
justify-content: center;
143143
width: 2rem;
144-
font-family: "Font Awesome 5 Free";
144+
font-family: "Font Awesome 6 Free";
145145
font-weight: 900;
146146
content: "\f054" #{"/*!rtl:\"\f053\"*/"};
147147
}
@@ -255,7 +255,7 @@
255255

256256
.navbar-toggler-icon::before {
257257
display: inline-block;
258-
font: normal normal 900 28px/1 "Font Awesome 5 Free";
258+
font: normal normal 900 28px/1 "Font Awesome 6 Free";
259259
color: var(--toggle-color);
260260
content: "\f00d";
261261
}

build/media_source/templates/administrator/atum/scss/blocks/_toolbar.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393

9494
&::after {
9595
width: 2.375rem;
96-
font-family: "Font Awesome 5 Free";
96+
font-family: "Font Awesome 6 Free";
9797
font-weight: 900;
9898
content: "\f078";
9999
border: 0;
@@ -163,7 +163,7 @@
163163
border-radius: 30px;
164164

165165
.toggler-toolbar-icon::before {
166-
font: normal normal 900 28px/1 "Font Awesome 5 Free";
166+
font: normal normal 900 28px/1 "Font Awesome 6 Free";
167167
color: var(--toggle-color);
168168
content: "\f00d";
169169
}

build/media_source/templates/administrator/atum/scss/vendor/fontawesome-free/fontawesome.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
$fa-css-prefix: fa;
33
$fa-font-path: "../../../../../../vendor/fontawesome-free/webfonts" !default;
44

5-
// Font Awesome 5 Free
5+
// Font Awesome 6 Free
66
@import "../../../../../../../../media/vendor/fontawesome-free/scss/fontawesome";
77
@import "../../../../../../../../media/vendor/fontawesome-free/scss/regular";
88
@import "../../../../../../../../media/vendor/fontawesome-free/scss/solid";
99

1010
// Brands must be imported last
1111
@import "../../../../../../../../media/vendor/fontawesome-free/scss/brands";
1212

13+
// B/C with Font Awesome 5
14+
@import "../../../../../../../../media/vendor/fontawesome-free/scss/shims";
15+
1316
// B/C for Icomoon
1417
@import "../../../../../../system/scss/icomoon";
1518

0 commit comments

Comments
 (0)