feat(web): C2 shell_css modes and page layout presets

Split injected shell CSS into vars/layout/widgets with full|minimal|off, add stacked/bare/rail layouts, and stop forcing has-sidebar when authors opt out.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-04 12:48:50 +08:00
1 parent b10a84466b
commit 155183eb30
10 files changed
+360 -43

No files matched your search

+23 -3
View File
@@ -179,9 +179,27 @@ Build a `render_list` effect: `{ render_list: { sel: { tag, items } } }`.
# page
+ `title`="Marqdo Web"
+ `intro`=""
+ `shell_css`=None
+ `layout`=None
> ensure_plugin
**> web_page_new title=`title` intro=`intro`**
**> web_page_new title=`title` intro=`intro` shell_css=`shell_css` layout=`layout`**
## shell_css
+ `mode`=full
Framework shell CSS mode for this page: `full` (default), `minimal` (vars only), or `off`/`none`.
*`out` = > table.put in=`self` at="shell_css" value=mode*
**out**
## layout
+ `layout`=sidebar
Page chrome layout: `sidebar` (default when a side slot exists), `stacked` (single column; no `has-sidebar` grid), `bare` (main only), or `rail`.
*`out` = > table.put in=`self` at="layout" value=layout*
**out**
## compose_components
+ `components`
@@ -568,11 +586,13 @@ Field table + rules table; submit writes through `# db`.
+ `admin_prefix`=/admin
+ `login_redirect`=None
+ `logout_redirect`=None
+ `shell_css`=None
+ `layout`=None
Construct an app. `admin=True` mounts the built-in CRUD UI under `admin_prefix` (default `/admin`). When `admin=False`, that prefix is **not** reserved — you may `route` your own pages there. Optional `login_redirect` / `logout_redirect` override post-auth landing (defaults: `{admin_prefix}` and `{admin_prefix}/login`).
Construct an app. `admin=True` mounts the built-in CRUD UI under `admin_prefix` (default `/admin`). When `admin=False`, that prefix is **not** reserved — you may `route` your own pages there. Optional `login_redirect` / `logout_redirect` override post-auth landing. Optional `shell_css` / `layout` become defaults for pages that do not set their own (see `page.shell_css` / `page.layout`).
> ensure_plugin
**> web_app_new page=`page` db=`db` admin=`admin` host=`host` port=`port` admin_prefix=`admin_prefix` login_redirect=`login_redirect` logout_redirect=`logout_redirect`**
**> web_app_new page=`page` db=`db` admin=`admin` host=`host` port=`port` admin_prefix=`admin_prefix` login_redirect=`login_redirect` logout_redirect=`logout_redirect` shell_css=`shell_css` layout=`layout`**
## route
+ `path`
+23 -3
View File
@@ -174,9 +174,27 @@ import table:lib/table.mq.md
# 页面
+ `标题`="站点"
+ `引言`=""
+ `壳样式`=None
+ `布局`=None
> 确保插件
**> web_page_new title=`标题` intro=`引言`**
**> web_page_new title=`标题` intro=`引言` shell_css=`壳样式` layout=`布局`**
## 壳样式
+ `模式`=full
框架壳 CSS:`full`(默认)/ `minimal`(仅变量)/ `off`。
*`out` = > table.put in=`自` at="shell_css" value=模式*
**out**
## 布局
+ `布局`=sidebar
页面壳:`sidebar`(有侧栏时默认双列)/ `stacked`(单列、不加 has-sidebar)/ `bare`(仅 main)/ `rail`。
*`out` = > table.put in=`自` at="layout" value=布局*
**out**
## 组件装配
+ `组件`
@@ -548,11 +566,13 @@ SEO / OpenGraph 元数据表(`|键|值|`)。如 `title`、`description`、`c
+ `后台前缀`=/admin
+ `登录回跳`=None
+ `登出回跳`=None
+ `壳样式`=None
+ `布局`=None
构造应用。`后台=真` 时在 `后台前缀`(默认 `/admin`)挂载内置 CRUD。`后台=假` 时该前缀**不再保留**,可自行 `路由` 到 `/admin…`。可选 `登录回跳` / `登出回跳`(默认分别为前缀本身与 `{前缀}/login`)。
构造应用。`后台=真` 时在 `后台前缀`(默认 `/admin`)挂载内置 CRUD。`后台=假` 时该前缀**不再保留**,可自行 `路由` 到 `/admin…`。可选 `登录回跳` / `登出回跳`。可选 `壳样式` / `布局` 作为未自设页面的默认(见 `页面.壳样式` / `页面.布局`)。
> 确保插件
**> web_app_new page=`页面` db=`数据库` admin=`后台` host=`主机` port=`端口` admin_prefix=`后台前缀` login_redirect=`登录回跳` logout_redirect=`登出回跳`**
**> web_app_new page=`页面` db=`数据库` admin=`后台` host=`主机` port=`端口` admin_prefix=`后台前缀` login_redirect=`登录回跳` logout_redirect=`登出回跳` shell_css=`壳样式` layout=`布局`**
## 路由
+ `路径`