fix(profile): align user page content width

This commit is contained in:
2026-09-23 12:16:26 +08:00
parent 5201f2ab6f
commit c315297d7f
6 changed files with 15 additions and 39 deletions
+9
View File
@@ -16,6 +16,15 @@
max-width: var(--container);
}
/* Profile routes use the exact value emitted from the admin content-width setting.
* Keep the shell contract here so the private center and public profile cannot
* drift through route-specific or legacy container rules. */
.site-main.content-shell.aksrt-profile,
.site-main.content-shell.aksrt-user-home {
max-width: var(--content-max, var(--container, 1440px));
box-sizing: border-box;
}
@media (min-width: 768px) {
.content-shell {
padding: 40px 24px 56px;
-8
View File
@@ -13,14 +13,6 @@
* - 密码强度条
*/
/* 用户主页 / 用户中心统一使用站点内容宽度,避免旧 page/dashboard 容器收窄。
* main 自身同时带 content-shell + aksrt-profile,不能写成 .aksrt-profile .content-shell。 */
.aksrt-profile.content-shell,
.content-shell.aksrt-profile {
width: 100%;
max-width: var(--container, 1440px);
}
/* ==================== 用户资料卡片(共享) ==================== */
.uc-header {
margin-bottom: 20px;
+1 -9
View File
@@ -10,15 +10,7 @@
*/
/* ==================== 用户中心容器 ==================== */
/* main 自身同时带 content-shell + aksrt-profile;宽度选择器应对准同一节点。 */
.aksrt-user-center .content-shell,
.aksrt-profile.content-shell,
.content-shell.aksrt-profile {
max-width: var(--container, 1440px);
width: 100%;
margin: 0 auto;
}
/* 主内容宽度由 frontend/layout.css 的 profile shell 合同统一管理。 */
.user-center,
.aksrt-profile.content-shell {
width: 100%;
-10
View File
@@ -1,10 +0,0 @@
/**
* Deprecated path.
*
* Public user-home tabs/cover are handled by assets/js/author.js
* (enqueued as aksrt-author on profile/user-home routes).
* This file intentionally does nothing to avoid double-binding.
*/
(function () {
'use strict';
})();
-12
View File
@@ -1,12 +0,0 @@
<?php
/**
* Public user home — page-owned sidebar.
*
* legacy public author page has no private-dashboard sidebar
* (主页概览 / 快捷入口 / 交易服务). Those belong on 用户中心 only.
* This part is intentionally a no-op for 1:1 author parity.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
@@ -419,6 +419,8 @@ test('profile routes load versioned leaf styles and keep dialogs hidden initiall
const userCenterJs = read('assets/js/routes/user-center.js');
const userHomeCss = read('assets/css/routes/user-home.css');
const profileLayoutCss = read('assets/css/routes/profile/layout.css');
const frontendLayoutCss = read('assets/css/frontend/layout.css');
const userCenterShellCss = read('assets/css/routes/user-center/shell.css');
const profileModalsCss = read('assets/css/routes/profile/modals.css');
const userCenterCreditsCss = read('assets/css/routes/user-center/credits.css');
const profileCredits = read('inc/helpers/user-center-renderers/profile-credits.php');
@@ -450,6 +452,9 @@ test('profile routes load versioned leaf styles and keep dialogs hidden initiall
assert.match(panelFavorites, /aksrt_render_user_home_pagination\(\(int\) \$favorites_query->max_num_pages, \(int\) \$favorites_page\)/);
assert.match(panelFavorites, /array_merge\(\$user_home_render_config, \['wrapper_class' => 'aksrt-user-home__post-list'\]\), \$favorites_query\)/);
assert.doesNotMatch(panelFavorites, /profile-list-item|\$_GET|add_query_arg/);
assert.match(frontendLayoutCss, /\.site-main\.content-shell\.aksrt-profile,[\s\S]*?\.site-main\.content-shell\.aksrt-user-home\s*\{[\s\S]*?max-width:\s*var\(--content-max, var\(--container, 1440px\)\)/);
assert.doesNotMatch(profileLayoutCss, /\.aksrt-profile\.content-shell\s*,[\s\S]*?max-width:\s*var\(--container/);
assert.doesNotMatch(userCenterShellCss, /\.aksrt-user-center \.content-shell\s*,[\s\S]*?max-width:\s*var\(--container/);
assert.match(profileLayoutCss, /\.aksrt-cover-menu__panel\[hidden\]\s*\{\s*display:\s*none\s*!important;\s*\}/);
assert.match(profileLayoutCss, /#aksrt-bg-file-input\[hidden\],[\s\S]*?#aksrt-avatar-file-input\[hidden\][\s\S]*?display:\s*none\s*!important;/);
assert.match(settingsSecurity, /data-modal="email-modal"[\s\S]*?<\/button>\s*<\/div>\s*<div class="security-action-item">[\s\S]*?data-modal="phone-modal"/);