@@ -27,7 +27,7 @@
color #888
box-shadow 0 1px rgba(0, 0, 0, 0.07)
- > i
+ > [data-fa]
margin-right 4px
> div
diff --git a/src/web/app/desktop/tags/home-widgets/channel.tag b/src/web/app/desktop/tags/home-widgets/channel.tag
index f22a5f76e..545bc38ac 100644
--- a/src/web/app/desktop/tags/home-widgets/channel.tag
+++ b/src/web/app/desktop/tags/home-widgets/channel.tag
@@ -1,9 +1,9 @@
- {
+
%fa:tv%{
channel ? channel.title : '%i18n:desktop.tags.mk-channel-home-widget.title%'
}
-
+
%i18n:desktop.tags.mk-channel-home-widget.get-started%
@@ -25,7 +25,7 @@
color #888
box-shadow 0 1px rgba(0, 0, 0, 0.07)
- > i
+ > [data-fa]
margin-right 4px
> button
diff --git a/src/web/app/desktop/tags/home-widgets/donation.tag b/src/web/app/desktop/tags/home-widgets/donation.tag
index 99ded1b5d..a51a7bebb 100644
--- a/src/web/app/desktop/tags/home-widgets/donation.tag
+++ b/src/web/app/desktop/tags/home-widgets/donation.tag
@@ -1,6 +1,6 @@
- %i18n:desktop.tags.mk-donation-home-widget.title%
+ %fa:heart%%i18n:desktop.tags.mk-donation-home-widget.title%
{'%i18n:desktop.tags.mk-donation-home-widget.text%'.substr(0, '%i18n:desktop.tags.mk-donation-home-widget.text%'.indexOf('{'))}@syuilo{'%i18n:desktop.tags.mk-donation-home-widget.text%'.substr('%i18n:desktop.tags.mk-donation-home-widget.text%'.indexOf('}') + 1)}
diff --git a/src/web/app/desktop/tags/home-widgets/post-form.tag b/src/web/app/desktop/tags/home-widgets/post-form.tag
index 9ca7fecfe..c8ccc5a30 100644
--- a/src/web/app/desktop/tags/home-widgets/post-form.tag
+++ b/src/web/app/desktop/tags/home-widgets/post-form.tag
@@ -2,7 +2,7 @@
- %i18n:desktop.tags.mk-post-form-home-widget.title%
+ %fa:pencil-alt%%i18n:desktop.tags.mk-post-form-home-widget.title%
@@ -25,7 +25,7 @@
color #888
box-shadow 0 1px rgba(0, 0, 0, 0.07)
- > i
+ > [data-fa]
margin-right 4px
> textarea
diff --git a/src/web/app/desktop/tags/home-widgets/recommended-polls.tag b/src/web/app/desktop/tags/home-widgets/recommended-polls.tag
index 5bfa83982..9bc29054d 100644
--- a/src/web/app/desktop/tags/home-widgets/recommended-polls.tag
+++ b/src/web/app/desktop/tags/home-widgets/recommended-polls.tag
@@ -1,15 +1,15 @@
- %i18n:desktop.tags.mk-recommended-polls-home-widget.title%
-
+ %fa:chart-pie%%i18n:desktop.tags.mk-recommended-polls-home-widget.title%
+
%i18n:desktop.tags.mk-recommended-polls-home-widget.nothing%
- %i18n:common.loading%
+ %fa:spinner .pluse .fw%%i18n:common.loading%
diff --git a/src/web/app/desktop/tags/home-widgets/rss-reader.tag b/src/web/app/desktop/tags/home-widgets/rss-reader.tag
index 12c1bee91..55ef6e2ab 100644
--- a/src/web/app/desktop/tags/home-widgets/rss-reader.tag
+++ b/src/web/app/desktop/tags/home-widgets/rss-reader.tag
@@ -1,12 +1,12 @@
- RSS
-
+ %fa:rss-square%RSS
+
- %i18n:common.loading%
+ %fa:spinner .pluse .fw%%i18n:common.loading%
diff --git a/src/web/app/desktop/tags/home-widgets/server.tag b/src/web/app/desktop/tags/home-widgets/server.tag
index b37d34736..c2eeb46b5 100644
--- a/src/web/app/desktop/tags/home-widgets/server.tag
+++ b/src/web/app/desktop/tags/home-widgets/server.tag
@@ -1,9 +1,9 @@
- %i18n:desktop.tags.mk-server-home-widget.title%
-
+ %fa:server%%i18n:desktop.tags.mk-server-home-widget.title%
+
- %i18n:common.loading%
+ %fa:spinner .pluse .fw%%i18n:common.loading%
@@ -31,7 +31,7 @@
color #888
box-shadow 0 1px rgba(0, 0, 0, 0.07)
- > i
+ > [data-fa]
margin-right 4px
> button
@@ -57,7 +57,7 @@
text-align center
color #aaa
- > i
+ > [data-fa]
margin-right 4px
@@ -235,7 +235,7 @@
-
CPU
+
%fa:microchip%CPU
{ cores } Cores
{ model }
@@ -261,7 +261,7 @@
&:first-child
font-weight bold
- > i
+ > [data-fa]
margin-right 4px
&:after
@@ -292,7 +292,7 @@
-
Memory
+
%fa:flask%Memory
Total: { bytesToSize(total, 1) }
Used: { bytesToSize(used, 1) }
Free: { bytesToSize(free, 1) }
@@ -319,7 +319,7 @@
&:first-child
font-weight bold
- > i
+ > [data-fa]
margin-right 4px
&:after
@@ -358,7 +358,7 @@
-
Storage
+
%fa:R hdd%Storage
Total: { bytesToSize(total, 1) }
Available: { bytesToSize(available, 1) }
Used: { bytesToSize(used, 1) }
@@ -385,7 +385,7 @@
&:first-child
font-weight bold
- > i
+ > [data-fa]
margin-right 4px
&:after
diff --git a/src/web/app/desktop/tags/home-widgets/slideshow.tag b/src/web/app/desktop/tags/home-widgets/slideshow.tag
index 4acb680e4..53fe04700 100644
--- a/src/web/app/desktop/tags/home-widgets/slideshow.tag
+++ b/src/web/app/desktop/tags/home-widgets/slideshow.tag
@@ -5,7 +5,7 @@
-
+
diff --git a/src/web/app/desktop/tags/home-widgets/user-recommendation.tag b/src/web/app/desktop/tags/home-widgets/user-recommendation.tag
index cf563db53..d95b50661 100644
--- a/src/web/app/desktop/tags/home-widgets/user-recommendation.tag
+++ b/src/web/app/desktop/tags/home-widgets/user-recommendation.tag
@@ -1,7 +1,7 @@
- %i18n:desktop.tags.mk-user-recommendation-home-widget.title%
-
+ %fa:users%%i18n:desktop.tags.mk-user-recommendation-home-widget.title%
+
%i18n:desktop.tags.mk-user-recommendation-home-widget.no-one%
- %i18n:common.loading%
+ %fa:spinner .pluse .fw%%i18n:common.loading%
diff --git a/src/web/app/desktop/tags/home.tag b/src/web/app/desktop/tags/home.tag
index 55f36e097..50f6c8460 100644
--- a/src/web/app/desktop/tags/home.tag
+++ b/src/web/app/desktop/tags/home.tag
@@ -1,6 +1,6 @@
-
完了
+
%fa:check%完了
ウィジェットを追加:
@@ -96,7 +96,7 @@
background darken($theme-color, 10%)
transition background 0s ease
- > i
+ > [data-fa]
margin-right 8px
> div
@@ -221,7 +221,7 @@
}
if (this.opts.customize) {
- dialog('
カスタマイズのヒント',
+ dialog('%fa:info-circle%カスタマイズのヒント',
'
ホームのカスタマイズでは、ウィジェットを追加/削除したり、ドラッグ&ドロップして並べ替えたりすることができます。
' +
'
一部のウィジェットは、右クリックすることで表示を変更することができます。
' +
'
ウィジェットを削除するには、ヘッダーの「ゴミ箱」と書かれたエリアにウィジェットをドラッグ&ドロップします。
' +
diff --git a/src/web/app/desktop/tags/input-dialog.tag b/src/web/app/desktop/tags/input-dialog.tag
index 78fd62ee8..f17527754 100644
--- a/src/web/app/desktop/tags/input-dialog.tag
+++ b/src/web/app/desktop/tags/input-dialog.tag
@@ -1,7 +1,7 @@
- { parent.title }
+ %fa:i-cursor%{ parent.title }
@@ -19,7 +19,7 @@
> mk-window
[data-yield='header']
- > i
+ > [data-fa]
margin-right 4px
[data-yield='content']
diff --git a/src/web/app/desktop/tags/messaging/room-window.tag b/src/web/app/desktop/tags/messaging/room-window.tag
index 1c6ff7c4b..7c0bb0d76 100644
--- a/src/web/app/desktop/tags/messaging/room-window.tag
+++ b/src/web/app/desktop/tags/messaging/room-window.tag
@@ -1,6 +1,6 @@
- メッセージ: { parent.user.name }
+ %fa:comments%メッセージ: { parent.user.name }
@@ -9,7 +9,7 @@
:scope
> mk-window
[data-yield='header']
- > i
+ > [data-fa]
margin-right 4px
[data-yield='content']
diff --git a/src/web/app/desktop/tags/messaging/window.tag b/src/web/app/desktop/tags/messaging/window.tag
index 5e478f036..529db11af 100644
--- a/src/web/app/desktop/tags/messaging/window.tag
+++ b/src/web/app/desktop/tags/messaging/window.tag
@@ -1,6 +1,6 @@
- メッセージ
+ %fa:comments%メッセージ
@@ -9,7 +9,7 @@
:scope
> mk-window
[data-yield='header']
- > i
+ > [data-fa]
margin-right 4px
[data-yield='content']
diff --git a/src/web/app/desktop/tags/notifications.tag b/src/web/app/desktop/tags/notifications.tag
index d7855363e..65334ddb2 100644
--- a/src/web/app/desktop/tags/notifications.tag
+++ b/src/web/app/desktop/tags/notifications.tag
@@ -8,7 +8,10 @@
@@ -16,7 +19,10 @@
@@ -24,7 +30,8 @@
@@ -32,7 +39,7 @@
@@ -40,7 +47,8 @@
@@ -48,7 +56,8 @@
@@ -56,18 +65,24 @@
- { notification._datetext }{ notifications[i + 1]._datetext }
+
+ %fa:angle-up%{ notification._datetext }
+ %fa:angle-down%{ notifications[i + 1]._datetext }
+
ありません!
-
%i18n:common.loading%
+
%fa:spinner .pluse .fw%%i18n:common.loading%
diff --git a/src/web/app/desktop/tags/pages/entrance.tag b/src/web/app/desktop/tags/pages/entrance.tag
index 02aeb922f..44548e418 100644
--- a/src/web/app/desktop/tags/pages/entrance.tag
+++ b/src/web/app/desktop/tags/pages/entrance.tag
@@ -150,7 +150,7 @@
-
+ %fa:question%
- %i18n:mobile.tags.mk-drive-file-viewer.hash%
+ %fa:hashtag%%i18n:mobile.tags.mk-drive-file-viewer.hash%
{ file.md5 }
@@ -114,7 +114,7 @@
> .created-at
color #bdbdbd
- > i
+ > [data-fa]
margin-right 2px
> .menu
@@ -149,7 +149,7 @@
border-color #444
box-shadow 0 1px 3px rgba(0, 0, 0, 0.075), inset 0 0 5px rgba(0, 0, 0, 0.2)
- > i
+ > [data-fa]
margin-right 4px
> .hash
@@ -167,7 +167,7 @@
color #555
font-size 0.9em
- > i
+ > [data-fa]
margin-right 4px
> code
diff --git a/src/web/app/mobile/tags/drive/file.tag b/src/web/app/mobile/tags/drive/file.tag
index 1499e8d7b..93a8dba7e 100644
--- a/src/web/app/mobile/tags/drive/file.tag
+++ b/src/web/app/mobile/tags/drive/file.tag
@@ -15,7 +15,7 @@
{ bytesToSize(file.datasize) }
-
+ %fa:R clock%
@@ -112,7 +112,7 @@
padding 0
color #BDBDBD
- > i
+ > [data-fa]
margin-right 2px
&[data-is-selected]
diff --git a/src/web/app/mobile/tags/drive/folder.tag b/src/web/app/mobile/tags/drive/folder.tag
index 27e86662c..196e7e326 100644
--- a/src/web/app/mobile/tags/drive/folder.tag
+++ b/src/web/app/mobile/tags/drive/folder.tag
@@ -1,6 +1,6 @@
-
{ folder.name }
+
%fa:folder%{ folder.name }
%fa:angle-right%
diff --git a/src/web/app/mobile/tags/init-following.tag b/src/web/app/mobile/tags/init-following.tag
index 6357f86a2..552b43348 100644
--- a/src/web/app/mobile/tags/init-following.tag
+++ b/src/web/app/mobile/tags/init-following.tag
@@ -6,9 +6,9 @@
おすすめのユーザーは見つかりませんでした。
-
読み込んでいます
+
%fa:spinner .pluse .fw%読み込んでいます
もっと見る
-
+
diff --git a/src/web/app/mobile/tags/notification-preview.tag b/src/web/app/mobile/tags/notification-preview.tag
index 1fdcc5764..ab923ea9d 100644
--- a/src/web/app/mobile/tags/notification-preview.tag
+++ b/src/web/app/mobile/tags/notification-preview.tag
@@ -3,48 +3,48 @@
{ notification.user.name }
-
{ getPostSummary(notification.post) }
+
%fa:quote-left%{ getPostSummary(notification.post) }%fa:quote-right%
-
{ notification.post.user.name }
-
{ getPostSummary(notification.post.repost) }
+
%fa:retweet%{ notification.post.user.name }
+
%fa:quote-left%{ getPostSummary(notification.post.repost) }%fa:quote-right%
-
{ notification.post.user.name }
+
%fa:quote-left%{ notification.post.user.name }
{ getPostSummary(notification.post) }
-
{ notification.user.name }
+
%fa:user-plus%{ notification.user.name }
-
{ notification.post.user.name }
+
%fa:reply%{ notification.post.user.name }
{ getPostSummary(notification.post) }
-
{ notification.post.user.name }
+
%fa:at%{ notification.post.user.name }
{ getPostSummary(notification.post) }
-
{ notification.user.name }
-
{ getPostSummary(notification.post) }
+
%fa:chart-pie%{ notification.user.name }
+
%fa:quote-left%{ getPostSummary(notification.post) }%fa:quote-right%
diff --git a/src/web/app/mobile/tags/page/drive.tag b/src/web/app/mobile/tags/page/drive.tag
index 218960c70..0033ffe65 100644
--- a/src/web/app/mobile/tags/page/drive.tag
+++ b/src/web/app/mobile/tags/page/drive.tag
@@ -12,11 +12,11 @@
this.on('mount', () => {
document.title = 'Misskey Drive';
- ui.trigger('title', '
%i18n:mobile.tags.mk-drive-page.drive%');
+ ui.trigger('title', '%fa:cloud%%i18n:mobile.tags.mk-drive-page.drive%');
ui.trigger('func', () => {
this.refs.ui.refs.browser.openContextMenu();
- }, 'ellipsis-h');
+ }, '%fa:ellipsis-h%');
this.refs.ui.refs.browser.on('begin-fetch', () => {
Progress.start();
@@ -37,7 +37,7 @@
history.pushState(null, title, '/i/drive');
document.title = title;
- ui.trigger('title', '
%i18n:mobile.tags.mk-drive-page.drive%');
+ ui.trigger('title', '%fa:cloud%%i18n:mobile.tags.mk-drive-page.drive%');
});
this.refs.ui.refs.browser.on('open-folder', (folder, silent) => {
@@ -50,7 +50,7 @@
document.title = title;
// TODO: escape html characters in folder.name
- ui.trigger('title', '
' + folder.name);
+ ui.trigger('title', '%fa:R folder-open%' + folder.name);
});
this.refs.ui.refs.browser.on('open-file', (file, silent) => {
diff --git a/src/web/app/mobile/tags/page/entrance/signup.tag b/src/web/app/mobile/tags/page/entrance/signup.tag
index 3798c9434..7b11bcad4 100644
--- a/src/web/app/mobile/tags/page/entrance/signup.tag
+++ b/src/web/app/mobile/tags/page/entrance/signup.tag
@@ -1,6 +1,6 @@
-
+
diff --git a/src/web/app/mobile/tags/page/home.tag b/src/web/app/mobile/tags/page/home.tag
index 1b2a4b1e1..99cc6b29b 100644
--- a/src/web/app/mobile/tags/page/home.tag
+++ b/src/web/app/mobile/tags/page/home.tag
@@ -22,12 +22,12 @@
this.on('mount', () => {
document.title = 'Misskey'
- ui.trigger('title', '%i18n:mobile.tags.mk-home.home%');
+ ui.trigger('title', '%fa:home%%i18n:mobile.tags.mk-home.home%');
document.documentElement.style.background = '#313a42';
ui.trigger('func', () => {
openPostForm();
- }, 'pencil');
+ }, '%fa:pencil-alt%');
Progress.start();
diff --git a/src/web/app/mobile/tags/page/messaging-room.tag b/src/web/app/mobile/tags/page/messaging-room.tag
index e66e03177..00ee26512 100644
--- a/src/web/app/mobile/tags/page/messaging-room.tag
+++ b/src/web/app/mobile/tags/page/messaging-room.tag
@@ -24,7 +24,7 @@
document.title = `%i18n:mobile.tags.mk-messaging-room-page.message%: ${user.name} | Misskey`;
// TODO: ユーザー名をエスケープ
- ui.trigger('title', '' + user.name);
+ ui.trigger('title', '%fa:R comments%' + user.name);
});
});
diff --git a/src/web/app/mobile/tags/page/messaging.tag b/src/web/app/mobile/tags/page/messaging.tag
index 11e8f8cb4..29e98ce09 100644
--- a/src/web/app/mobile/tags/page/messaging.tag
+++ b/src/web/app/mobile/tags/page/messaging.tag
@@ -13,7 +13,7 @@
this.on('mount', () => {
document.title = 'Misskey | %i18n:mobile.tags.mk-messaging-page.message%';
- ui.trigger('title', '%i18n:mobile.tags.mk-messaging-page.message%');
+ ui.trigger('title', '%fa:R comments%%i18n:mobile.tags.mk-messaging-page.message%');
this.refs.ui.refs.index.on('navigate-user', user => {
this.page('/i/messaging/' + user.username);
diff --git a/src/web/app/mobile/tags/page/notifications.tag b/src/web/app/mobile/tags/page/notifications.tag
index 743de0439..1db9c5d66 100644
--- a/src/web/app/mobile/tags/page/notifications.tag
+++ b/src/web/app/mobile/tags/page/notifications.tag
@@ -14,12 +14,12 @@
this.on('mount', () => {
document.title = 'Misskey | %i18n:mobile.tags.mk-notifications-page.notifications%';
- ui.trigger('title', '%i18n:mobile.tags.mk-notifications-page.notifications%');
+ ui.trigger('title', '%fa:R bell%%i18n:mobile.tags.mk-notifications-page.notifications%');
document.documentElement.style.background = '#313a42';
ui.trigger('func', () => {
this.readAll();
- }, 'check');
+ }, '%fa:check%');
Progress.start();
diff --git a/src/web/app/mobile/tags/page/post.tag b/src/web/app/mobile/tags/page/post.tag
index 6888229f8..5303ca8d3 100644
--- a/src/web/app/mobile/tags/page/post.tag
+++ b/src/web/app/mobile/tags/page/post.tag
@@ -1,11 +1,11 @@
- %i18n:mobile.tags.mk-post-page.next%
+ %fa:angle-up%%i18n:mobile.tags.mk-post-page.next%
- %i18n:mobile.tags.mk-post-page.prev%
+ %fa:angle-down%%i18n:mobile.tags.mk-post-page.prev%
@@ -20,14 +20,14 @@
' + I.name + '') }/>
ver { _VERSION_ } (葵 aoi)
diff --git a/src/web/app/mobile/tags/page/settings/signin.tag b/src/web/app/mobile/tags/page/settings/signin.tag
index a91ebfb14..1a9e63886 100644
--- a/src/web/app/mobile/tags/page/settings/signin.tag
+++ b/src/web/app/mobile/tags/page/settings/signin.tag
@@ -11,7 +11,7 @@
this.on('mount', () => {
document.title = 'Misskey | %i18n:mobile.tags.mk-signin-history-page.signin-history%';
- ui.trigger('title', '%i18n:mobile.tags.mk-signin-history-page.signin-history%');
+ ui.trigger('title', '%fa:sign-in-alt%%i18n:mobile.tags.mk-signin-history-page.signin-history%');
});
diff --git a/src/web/app/mobile/tags/page/settings/twitter.tag b/src/web/app/mobile/tags/page/settings/twitter.tag
index 870eeeb5b..02661d3b6 100644
--- a/src/web/app/mobile/tags/page/settings/twitter.tag
+++ b/src/web/app/mobile/tags/page/settings/twitter.tag
@@ -11,7 +11,7 @@
this.on('mount', () => {
document.title = 'Misskey | %i18n:mobile.tags.mk-twitter-setting-page.twitter-integration%';
- ui.trigger('title', '%i18n:mobile.tags.mk-twitter-setting-page.twitter-integration%');
+ ui.trigger('title', '%fa:B twitter%%i18n:mobile.tags.mk-twitter-setting-page.twitter-integration%');
});
diff --git a/src/web/app/mobile/tags/page/user.tag b/src/web/app/mobile/tags/page/user.tag
index 1abeab492..78ca534eb 100644
--- a/src/web/app/mobile/tags/page/user.tag
+++ b/src/web/app/mobile/tags/page/user.tag
@@ -20,7 +20,7 @@
Progress.done();
document.title = user.name + ' | Misskey';
// TODO: ユーザー名をエスケープ
- ui.trigger('title', '' + user.name);
+ ui.trigger('title', '%fa:user%' + user.name);
});
});
diff --git a/src/web/app/mobile/tags/post-detail.tag b/src/web/app/mobile/tags/post-detail.tag
index 28071a5ca..ceac56340 100644
--- a/src/web/app/mobile/tags/post-detail.tag
+++ b/src/web/app/mobile/tags/post-detail.tag
@@ -1,7 +1,7 @@
@@ -15,7 +15,7 @@
-
+ %fa:retweet%
{ post.user.name }
がRepost
@@ -44,16 +44,16 @@
@@ -126,7 +126,7 @@
margin 0 8px 0 0
border-radius 6px
- i
+ [data-fa]
margin-right 4px
.name
@@ -208,16 +208,6 @@
@media (min-width 500px)
font-size 24px
- .link
- &:after
- content "\f14c"
- display inline-block
- padding-left 2px
- font-family FontAwesome
- font-size .9em
- font-weight 400
- font-style normal
-
> mk-url-preview
margin-top 8px
diff --git a/src/web/app/mobile/tags/post-form.tag b/src/web/app/mobile/tags/post-form.tag
index 2912bfdfa..3ac7296f7 100644
--- a/src/web/app/mobile/tags/post-form.tag
+++ b/src/web/app/mobile/tags/post-form.tag
@@ -1,6 +1,6 @@
-
+
{ 1000 - refs.text.value.length }
@@ -14,15 +14,15 @@
-
+
%fa:plus%
-
-
-
-
+
+
+
+
diff --git a/src/web/app/status/tags/index.tag b/src/web/app/status/tags/index.tag
index cb379f66b..dcadc6617 100644
--- a/src/web/app/status/tags/index.tag
+++ b/src/web/app/status/tags/index.tag
@@ -1,6 +1,6 @@
MisskeyStatus
- %i18n:status.all-systems-maybe-operational%
+ %fa:info-circle%%i18n:status.all-systems-maybe-operational%
@@ -19,7 +19,7 @@
font-size 24px
font-weight normal
- > i
+ > [data-fa]
font-style normal
color #f43b16
@@ -31,7 +31,7 @@
//border solid 1px #99ccb2
border-radius 4px
- > i
+ > [data-fa]
margin-right 5px
> main
diff --git a/webpack/module/rules/fa.ts b/webpack/module/rules/fa.ts
new file mode 100644
index 000000000..15f8775f0
--- /dev/null
+++ b/webpack/module/rules/fa.ts
@@ -0,0 +1,60 @@
+/**
+ * Replace fontawesome symbols
+ */
+
+const StringReplacePlugin = require('string-replace-webpack-plugin');
+
+import * as fontawesome from '@fortawesome/fontawesome';
+import * as regular from '@fortawesome/fontawesome-free-regular';
+import * as solid from '@fortawesome/fontawesome-free-solid';
+import * as brands from '@fortawesome/fontawesome-free-brands';
+
+// Add icons
+fontawesome.library.add(regular);
+fontawesome.library.add(solid);
+fontawesome.library.add(brands);
+
+export default () => ({
+ enforce: 'pre',
+ test: /\.(tag|js|ts)$/,
+ exclude: /node_modules/,
+ loader: StringReplacePlugin.replace({
+ replacements: [{
+ pattern: /%fa:(.+?)%/g, replacement: (_, key) => {
+ const args = key.split(' ');
+ let prefix = 'fas';
+ const classes = [];
+ let transform = '';
+ let name;
+
+ args.forEach(arg => {
+ if (arg == 'R' || arg == 'S' || arg == 'B') {
+ prefix =
+ arg == 'R' ? 'far' :
+ arg == 'S' ? 'fas' :
+ arg == 'B' ? 'fab' :
+ '';
+ } else if (arg[0] == '.') {
+ classes.push('fa-' + arg.substr(1));
+ } else if (arg[0] == '-') {
+ transform = arg.substr(1).split('|').join(' ');
+ } else {
+ name = arg;
+ }
+ });
+
+ const icon = fontawesome.icon({ prefix, iconName: name }, {
+ classes: classes
+ });
+
+ if (icon) {
+ icon.transform = fontawesome.parse.transform(transform);
+ return `${icon.html[0]}`;
+ } else {
+ console.warn(`'${name}' not found in fa`);
+ return '';
+ }
+ }
+ }]
+ })
+});
diff --git a/webpack/module/rules/index.ts b/webpack/module/rules/index.ts
index 9c1262b3d..79740ce48 100644
--- a/webpack/module/rules/index.ts
+++ b/webpack/module/rules/index.ts
@@ -1,4 +1,5 @@
import i18n from './i18n';
+import fa from './fa';
import base64 from './base64';
import themeColor from './theme-color';
import tag from './tag';
@@ -7,6 +8,7 @@ import typescript from './typescript';
export default (lang, locale) => [
i18n(lang, locale),
+ fa(),
base64(),
themeColor(),
tag(),