fix(profile): let user center and public profile span the full viewport
This commit is contained in:
@@ -206,7 +206,6 @@ Full admin panel preserved (settings, OAuth, content tools, etc).
|
||||
--float-btn-bg: rgba(200, 200, 200, 0.40);
|
||||
|
||||
/* ===== AKSRT-to-AKSRT canonical aliases ===== */
|
||||
--content-max: var(--container);
|
||||
--font-heading: var(--font-ui);
|
||||
--radius-card: var(--radius);
|
||||
--radius-md: var(--radius);
|
||||
@@ -3468,12 +3467,13 @@ html.dark body.has-scrolled .site-nav--glass {
|
||||
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. */
|
||||
/* 用户中心(双栏)与公开主页整页铺满视口,不受后台「内容最大宽度」限制。
|
||||
* 内容最大宽度只约束文章/归档等单栏阅读场景;两栏需要横向空间,
|
||||
* 被 1200 一类阅读宽度收窄会在左右两侧留下大片空白。
|
||||
* 统一在此声明,避免路由 CSS 与 legacy .container 规则各自漂移。 */
|
||||
.site-main.content-shell.aksrt-profile,
|
||||
.site-main.content-shell.aksrt-user-home {
|
||||
max-width: var(--content-max, var(--container, 1440px));
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -181,7 +181,6 @@
|
||||
--float-btn-bg: rgba(200, 200, 200, 0.40);
|
||||
|
||||
/* ===== AKSRT-to-AKSRT canonical aliases ===== */
|
||||
--content-max: var(--container);
|
||||
--font-heading: var(--font-ui);
|
||||
--radius-card: var(--radius);
|
||||
--radius-md: var(--radius);
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
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. */
|
||||
/* 用户中心(双栏)与公开主页整页铺满视口,不受后台「内容最大宽度」限制。
|
||||
* 内容最大宽度只约束文章/归档等单栏阅读场景;两栏需要横向空间,
|
||||
* 被 1200 一类阅读宽度收窄会在左右两侧留下大片空白。
|
||||
* 统一在此声明,避免路由 CSS 与 legacy .container 规则各自漂移。 */
|
||||
.site-main.content-shell.aksrt-profile,
|
||||
.site-main.content-shell.aksrt-user-home {
|
||||
max-width: var(--content-max, var(--container, 1440px));
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ class InlineStyleBuilder {
|
||||
$sidebar_width = max(200, min(400, $sidebar_width));
|
||||
|
||||
$layout_vars = [
|
||||
'--content-max' => $content_width,
|
||||
'--container' => $content_width,
|
||||
'--container-wide' => $container_wide,
|
||||
'--mian-max-width' => $content_width, // legacy typo token
|
||||
|
||||
@@ -453,10 +453,12 @@ 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\)\)/);
|
||||
// User center (two columns) and the public profile fill the viewport; the admin
|
||||
// content max width stays a single-column reading constraint.
|
||||
assert.match(frontendLayoutCss, /\.site-main\.content-shell\.aksrt-profile,[\s\S]*?\.site-main\.content-shell\.aksrt-user-home\s*\{[\s\S]*?max-width:\s*100%/);
|
||||
// The front end enqueues build/public.min.css, not the frontend/ sources, so a
|
||||
// source-only edit never reaches the page. The bundle must carry the contract.
|
||||
assert.match(publicBundleCss, /\.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.match(publicBundleCss, /\.site-main\.content-shell\.aksrt-profile,[\s\S]*?\.site-main\.content-shell\.aksrt-user-home\s*\{[\s\S]*?max-width:\s*100%/);
|
||||
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*\}/);
|
||||
@@ -682,7 +684,8 @@ test('content max width is one contract from admin option to runtime var', () =>
|
||||
assert.match(globalSchema.match(/'container_max_width'[^\n]*/)[0], /'min' => 0/);
|
||||
|
||||
assert.match(themeSearch, /max\(1200, min\(2200, \$width\)\)/);
|
||||
assert.match(builder, /'--content-max'\s*=> \$content_width/);
|
||||
// The unused no-sidebar width token was removed; no runtime var may revive it.
|
||||
assert.doesNotMatch(builder, /content-no-sidebar-max/);
|
||||
assert.match(builder, /'--container'\s*=> \$content_width/);
|
||||
// User pages are full-bleed now, so the aliased width tokens are dead.
|
||||
assert.doesNotMatch(builder, /--content-max|content-no-sidebar-max/);
|
||||
assert.doesNotMatch(read('assets/css/core/tokens.css'), /--content-max/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user