Skip to content

Commit 80fd975

Browse files
committed
fix: tags page edit, preload fa kit
1 parent 3594b0a commit 80fd975

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

extensions/tags/less/admin/TagsPage.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
.icon {
3535
margin-right: 10px;
3636
}
37+
38+
// FontAwesome Kit sets --fa-display variable which breaks layout
39+
// Only target tag icons (not button icons), as Button-icon has its own fix
40+
> li .icon {
41+
--fa-display: inline-block;
42+
display: inline-block !important;
43+
line-height: inherit !important;
44+
}
3745
}
3846

3947
.TagListItem-info {

framework/core/less/common/Button.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@
268268
}
269269
.Button-icon {
270270
line-height: inherit;
271+
272+
// FontAwesome Kit overrides display to block, breaking button flex layout
273+
// Force inline-block to work with button's inline-flex container
274+
display: inline-block !important;
271275
}
272276
.Button-icon,
273277
.Button-caret {

framework/core/src/Frontend/FrontendServiceProvider.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,26 @@ public function register(): void
109109
if ($fontAwesome->useCdn()) {
110110
$cdnUrl = $fontAwesome->cdnUrl();
111111
if (! empty($cdnUrl)) {
112-
$document->css[] = $cdnUrl;
112+
// Preload CDN CSS for better performance
113+
$document->preloads[] = [
114+
'href' => $cdnUrl,
115+
'as' => 'style',
116+
'crossorigin' => 'anonymous'
117+
];
118+
// Add CDN CSS with crossorigin for better caching
119+
$document->head[] = '<link rel="stylesheet" href="'.e($cdnUrl).'" crossorigin="anonymous">';
113120
}
114121
} elseif ($fontAwesome->useKit()) {
115122
$kitUrl = $fontAwesome->kitUrl();
116123
if (! empty($kitUrl)) {
117-
$document->js[] = $kitUrl;
124+
// Preload Kit JS for better performance
125+
$document->preloads[] = [
126+
'href' => $kitUrl,
127+
'as' => 'script',
128+
'crossorigin' => 'anonymous'
129+
];
130+
// Add Kit JS with crossorigin for better caching
131+
$document->head[] = '<script src="'.e($kitUrl).'" crossorigin="anonymous"></script>';
118132
}
119133
}
120134

0 commit comments

Comments
 (0)