修正 fa fab 的字体优先级,微信、QQ、微博等图标现在使用 Brands 字体。

This commit is contained in:
2026-08-19 23:11:44 +08:00
parent 3312323f6e
commit 13ed02c93a
4 changed files with 28 additions and 0 deletions
+7
View File
@@ -42,6 +42,13 @@ a[href] {
transition: color 0.2s, background 0.3s, opacity 0.3s, box-shadow 0.3s, transform 0.3s;
}
/* Font Awesome 5: when legacy markup includes both `fa` and `fab`, the
* generic Solid rule must not override the Brands font face. */
.fa.fab {
font-family: "Font Awesome 5 Brands";
font-weight: 400;
}
.skip-link {
position: absolute;
left: 16px;
+7
View File
@@ -215,6 +215,13 @@ class SchemaProvider {
}
if (in_array($type, ['select', 'radio', 'palette', 'image_select'], true) && !empty($field['options'])) {
// Optional enum fields use an empty string to mean "unset".
// This is required for clearable palettes such as the footer
// background preset, whose default is intentionally empty.
if ($value === '' && empty($field['required'])) {
continue;
}
$valid_values = array_column($field['options'], 'value');
// Multi-select: accept array values when schema.multiple is set
// (legacy / SPA may still use type=select multiple).
@@ -14,6 +14,7 @@ const provider = read('src/Admin/SchemaProvider.php')
const settingsFacade = read('src/Settings/Settings.php')
const scriptsPart1c = read('src/Core/ScriptsPart1c.php')
const footerCss = read('assets/css/frontend/footer/zibll-shell.css')
const frontendBaseCss = read('assets/css/frontend/base.css')
const headerMenuButtons = read('inc/helpers/aksrt-header-menu-buttons.php')
function activeRepositorySource() {
@@ -178,6 +179,17 @@ test('front-end page-display consumers read only the canonical section contracts
assert.doesNotMatch(scriptsPart1c, /\$runtime_routes\[['"]cart['"]\]/)
})
test('footer brand icons keep the Brands font when legacy fa prefix is present', () => {
const footer = read('footer.php')
const icons = read('inc/helpers/aksrt-icons.php')
assert.match(footer, /class="fa fab fa-weixin"/)
assert.match(footer, /class="fa fab fa-qq"/)
assert.match(footer, /class="fa fab fa-weibo"/)
assert.match(frontendBaseCss, /\.fa\.fab\s*\{[^}]*font-family:\s*"Font Awesome 5 Brands"[^}]*font-weight:\s*400/s)
assert.match(icons, /'wechat'\s*=>\s*'fa fab fa-weixin'/)
})
test('save contract rejects invalid input and round-trips canonical nested values', () => {
const result = spawnSync(process.env.PHP_BINARY || 'php', [path.join(__dirname, 'page-display-save-harness.php')], {
cwd: root,
@@ -167,6 +167,8 @@ namespace {
$header_clean = $provider->sanitize_payload('page_display', $header_payload, 'header-components');
$footer_payload = [
// Empty means no preset background; it must remain a valid optional palette value.
'footer_theme_bg' => '',
'fcode_t1_code' => '<strong>Allowed</strong><script>bad()</script>',
'footer_contact_weibo' => 'javascript:alert(1)',
'footer_mini_img' => [[