fix(profile): serve unified content width and accept full admin range
This commit is contained in:
1 parent
c315297d7f
commit
10c63e02d5
5 files changed
+38
-4
No files matched your search
@@ -141,7 +141,9 @@ class GlobalSchema {
|
||||
['key' => 'close_backdrop', 'label' => '关闭毛玻璃效果', 'type' => 'switch', 'default' => false],
|
||||
]],
|
||||
['key' => 'layout', 'title' => '布局设置', 'fields' => [
|
||||
['key' => 'container_max_width', 'label' => '内容最大宽度', 'type' => 'number', 'default' => 1200, 'min' => 0, 'max' => 1600],
|
||||
// 0(全宽)与 1200–2200 与设置页下拉选项、Settings::container_max_width() 归一化区间一致;
|
||||
// 上限低于 UI 可选项会让后台保存被校验拒绝,页面宽度卡在旧值。
|
||||
['key' => 'container_max_width', 'label' => '内容最大宽度', 'type' => 'number', 'default' => 1200, 'min' => 0, 'max' => 2200],
|
||||
['key' => 'sidebar_enabled', 'label' => '开启侧边栏', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'sidebar_position', 'label' => '侧边栏位置', 'type' => 'radio', 'default' => 'right', 'options' => [
|
||||
['label' => '左侧', 'value' => 'left'],
|
||||
|
||||
@@ -23,7 +23,6 @@ class InlineStyleBuilder {
|
||||
$sidebar_cfg = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_sidebar_config() : ['width' => 311, 'enabled' => true, 'position' => 'right'];
|
||||
|
||||
$content_width = $container_max === 0 ? '100%' : $container_max . 'px';
|
||||
$content_no_sidebar_max = $container_max === 0 ? '100%' : max(860, $container_max - 220) . 'px';
|
||||
$container_wide = $container_max === 0 ? '100%' : max(1280, $container_max + 160) . 'px';
|
||||
$radius_sm = max(0, $border_radius - 2);
|
||||
$radius_lg = $border_radius + 4;
|
||||
@@ -47,7 +46,6 @@ class InlineStyleBuilder {
|
||||
|
||||
$layout_vars = [
|
||||
'--content-max' => $content_width,
|
||||
'--content-no-sidebar-max' => $content_no_sidebar_max,
|
||||
'--container' => $content_width,
|
||||
'--container-wide' => $container_wide,
|
||||
'--mian-max-width' => $content_width, // legacy typo token
|
||||
|
||||
Reference in new issue
Block a user