Release 2.7.0: executable handbooks and native user-site workflows
This commit is contained in:
1 parent
aa0c4d0f55
commit
d9aef957f7
562 files changed
+21064
-20387
No files matched your search
@@ -18,15 +18,16 @@ smoke.sh # curl checks against a running serve
|
||||
|
||||
## Run
|
||||
|
||||
```bash
|
||||
bash scripts/build-web-plugin.sh
|
||||
export MARQDO_EXT=$PWD/ext # if ~/.marqdo/ext is stale
|
||||
export MARQDO_WEB_PLUGIN=$PWD/plugins/web/build/libweb.so
|
||||
cd examples/marqdo-blog && marqdo run serve.mq.md
|
||||
# other terminal:
|
||||
bash examples/marqdo-blog/smoke.sh
|
||||
从仓库根使用当前 CLI 和开发手册准备原生插件,再调用启动函数:
|
||||
|
||||
```sh
|
||||
target/debug/marqdo call skills/marqdo-dev/index.mq.md prepare_web --effects plugin --fs-root . --require-ok --json
|
||||
target/debug/marqdo call examples/marqdo-blog/serve.mq.md main --effects plugin,fs.write,network.write --fs-root examples/marqdo-blog --require-ok --json
|
||||
```
|
||||
|
||||
默认数据库按授权站点根解析到 data/blog.db,重启保留已有文章。准备工程插件见开发入口的 prepare_engineering;验收使用独占副本,不删除现有数据库。
|
||||
|
||||
|
||||
| Path | Artifact |
|
||||
|------|----------|
|
||||
| `/` | Document home + post cards |
|
||||
|
||||
@@ -10,11 +10,15 @@ auth: none
|
||||
|
||||
# main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Result or browser effect record assembled below |
|
||||
|
||||
Echo request fields bound via Artifact Metadata (`arg` overlays).
|
||||
|
||||
**msg = message**
|
||||
We first **msg = `message`** for the next step.
|
||||
1. not `msg`
|
||||
**msg = ""**
|
||||
We first **msg = ""** for the next step.
|
||||
2. *
|
||||
|
||||
`out` =
|
||||
@@ -23,4 +27,4 @@ Echo request fields bound via Artifact Metadata (`arg` overlays).
|
||||
|----|---------|
|
||||
| True | `msg` |
|
||||
|
||||
*out*
|
||||
After these steps, return *out*.
|
||||
@@ -11,10 +11,14 @@ description: Health ping — documentation is the API (ADR 0007).
|
||||
|
||||
# main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | Result or browser effect record assembled below |
|
||||
|
||||
`out` =
|
||||
|
||||
| ok | service |
|
||||
|----|---------|
|
||||
| True | marqdo-blog |
|
||||
|
||||
*out*
|
||||
After these steps, return *out*.
|
||||
@@ -4,6 +4,10 @@ markup: occlusion
|
||||
|
||||
## 页脚
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | The value explicitly returned below; conditional returns follow the selected branch |
|
||||
|
||||
站点页脚。放版权与概览链接。
|
||||
|
||||
`页脚` =
|
||||
@@ -14,4 +18,4 @@ markup: occlusion
|
||||
| 关于 | /about | |
|
||||
| 后台 | /admin | |
|
||||
|
||||
*`页脚`*
|
||||
After these steps, return *页脚*.
|
||||
@@ -4,6 +4,10 @@ markup: occlusion
|
||||
|
||||
## 导航
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | The value explicitly returned below; conditional returns follow the selected branch |
|
||||
|
||||
站点顶部导航。首项是站点名(渐变 Logo 由主题 CSS 处理),`后台` 指向需要登录的 `/admin`。
|
||||
|
||||
`导航` =
|
||||
@@ -16,4 +20,4 @@ markup: occlusion
|
||||
| 关于 | /about | |
|
||||
| 后台 | /admin | |
|
||||
|
||||
*`导航`*
|
||||
After these steps, return *导航*.
|
||||
@@ -4,6 +4,10 @@ markup: occlusion
|
||||
|
||||
## 侧栏
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | The value explicitly returned below; conditional returns follow the selected branch |
|
||||
|
||||
右侧归档面板:文章入口、标签、实时小部件。
|
||||
|
||||
`侧栏` =
|
||||
@@ -16,4 +20,4 @@ markup: occlusion
|
||||
| 发布文章 | /admin/new | |
|
||||
| 实时终端 | /#live | |
|
||||
|
||||
*`侧栏`*
|
||||
After these steps, return *侧栏*.
|
||||
@@ -1,46 +1,61 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: blog posts schema
|
||||
title: 当前 Artifact 博客数据调用手册
|
||||
import:
|
||||
document: lib/document.mq.md
|
||||
data: ext/data/db.mq.md
|
||||
fs: lib/fs.mq.md
|
||||
text: lib/text.mq.md
|
||||
---
|
||||
|
||||
本文件负责可调用的说明与编排,[posts.tables.md](posts.tables.md)负责可独立阅读的 Markdown 常量。调用时把 --fs-root 指向 examples/marqdo-blog,读取需要 fs.read;连接数据库或编译样式时还需要 plugin。
|
||||
|
||||
## schema
|
||||
|
||||
`fields` =
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| title | text | False |
|
||||
| slug | text | False |
|
||||
| summary | text | True |
|
||||
| content | text | True |
|
||||
| tag | text | True |
|
||||
| created_at | text | True |
|
||||
当前站点的文章字段包括标题、slug、摘要、正文、标签和创建日期。原生数据库初始化器负责 id;本结构保留当前自动列表与详情页所需字段。
|
||||
|
||||
*fields*
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [posts.tables.md](posts.tables.md#schema);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
完成后返回*[读取schema的实际 Markdown 常量](document.read_table(path="db/posts.tables.md", title="schema"))*.
|
||||
|
||||
## seed
|
||||
|
||||
`rows` =
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
| title | slug | summary | content | tag | created_at |
|
||||
|-------|------|---------|---------|-----|------------|
|
||||
| Hello Marqdo | hello | Welcome | Hello — executable documents. | intro | 2026-09-01 |
|
||||
| Artifact Web | artifact-web | Document first | Pages are mq.md files. | design | 2026-09-28 |
|
||||
两篇当前站点的起始文章保留稳定 slug、内容与日期。只有调用 open 且文章表为空时才插入;读取种子本身不会改变现有文章。
|
||||
|
||||
*rows*
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [posts.tables.md](posts.tables.md#seed);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
完成后返回*[读取seed的实际 Markdown 常量](document.read_table(path="db/posts.tables.md", title="seed"))*.
|
||||
|
||||
## open
|
||||
+ `url`="sqlite:data/blog.db"
|
||||
|
||||
**store = > data.db url=`url`**
|
||||
**fields = > schema**
|
||||
> `store`.init name=posts fields=`fields`
|
||||
**existing = > `store`.select table="posts" limit=1**
|
||||
1. `existing`
|
||||
*store*
|
||||
2. *
|
||||
**seed = > seed**
|
||||
> `store`.insert table=posts rows=`seed`
|
||||
*store*
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| url | any | None | None 使用授权站点根内 data/blog.db;验收可传独占绝对 URI |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 已初始化且保留原有文章的实际数据库资源 |
|
||||
|
||||
使用`url`=None,以 examples/marqdo-blog 为 --fs-root 授予 fs.write 与 plugin。默认路径先通过固有能力创建 data 目录,再解析真实绝对文件地址,避免被插件模块位置或终端工作目录影响。显式 SQLite 路径同样经过根目录和符号链接检查;其他受支持后端按其连接契约执行,文件授权不限制外部数据库服务。
|
||||
|
||||
字段与种子由原生 Markdown 读取器保留字面类型。初始化只确保文章表存在,再查一行判断是否已有业务数据;只为空表插入原来的两条记录。已有或部分填充的表都原样保留,这不是列迁移器,也不会删除或重排用户文章。连接、结构或插入失败应停止启动,不能继续监听并声称数据库已经准备好。
|
||||
|
||||
隔离验收使用调用者拥有的临时站点副本,保留同一资源继续查询与写入。进程退出、连接关闭后再清理该目录,不对示例的现有 data 目录执行重置。读取结构或种子本身不写库,写入只发生在这份明确初始化流程里。
|
||||
|
||||
1. `url` == None
|
||||
我们 **[创建本站默认数据目录](fs.make_dirs(path="data"))**、**file = [按原生授权根解析数据库文件](fs.resolve(path="data/blog.db"))** 和 **url = "sqlite:" + file**。
|
||||
1. [明确选择 SQLite 后端](text.starts_with(text=`url`, prefix="sqlite:"))
|
||||
我们 **file = [取出实际 SQLite 地址](text.replace(text=`url`, old="sqlite:", new="", count=1))**、**file = [检查根目录和符号链接边界](fs.resolve(path=`file`))** 和 **url = "sqlite:" + file**。
|
||||
我们 **store = [连接实际选择的数据库](data.db(url=`url`))** 和 **fields = [读取当前文章结构](schema())**。
|
||||
接着 **[确保文章结构但不清空数据](> `store`.init name="posts" fields=`fields`)** 和 **existing = [检查是否已有业务文章](> `store`.select table="posts" limit=1)**。
|
||||
1. not `existing`
|
||||
我们 **rows = [读取空表使用的原始记录](seed())** 和 **[只初始化空表](> `store`.insert table="posts" rows=`rows`)**。
|
||||
准备完成后返回 *store*,供当前服务流程继续使用。
|
||||
@@ -0,0 +1,25 @@
|
||||
# 当前 Artifact 博客数据
|
||||
|
||||
这里保存原生字面 GFM 数据。调用函数通过 document.read_table 读取所选章节;不会执行本文件中的说明或示例。
|
||||
|
||||
## schema
|
||||
|
||||
当前站点的文章字段包括标题、slug、摘要、正文、标签和创建日期。原生数据库初始化器负责 id;本结构保留当前自动列表与详情页所需字段。
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| title | text | False |
|
||||
| slug | text | False |
|
||||
| summary | text | True |
|
||||
| content | text | True |
|
||||
| tag | text | True |
|
||||
| created_at | text | True |
|
||||
|
||||
## seed
|
||||
|
||||
两篇当前站点的起始文章保留稳定 slug、内容与日期。只有调用 open 且文章表为空时才插入;读取种子本身不会改变现有文章。
|
||||
|
||||
| title | slug | summary | content | tag | created_at |
|
||||
|-------|------|---------|---------|-----|------------|
|
||||
| Hello Marqdo | hello | Welcome | Hello — executable documents. | intro | 2026-09-01 |
|
||||
| Artifact Web | artifact-web | Document first | Pages are mq.md files. | design | 2026-09-28 |
|
||||
@@ -1,50 +1,44 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: 博客表结构调用手册
|
||||
import:
|
||||
document: lib/document.mq.md
|
||||
---
|
||||
|
||||
本文件负责可调用的说明与编排,[schema.tables.md](schema.tables.md)负责可独立阅读的 Markdown 常量。调用时把 --fs-root 指向 examples/marqdo-blog,读取需要 fs.read;连接数据库或编译样式时还需要 plugin。
|
||||
|
||||
## posts
|
||||
|
||||
文章主表结构。`slug` 用于详情页 `/post/{slug}` 的动态路由;`content` 存 Markdown 正文;`tag` 是主标签(tags 表 slug)。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`schema` =
|
||||
文章结构保留 id、标题、slug、摘要、Markdown 正文、主标签和时间字段。slug 对应文章详情路由;可空声明控制存储约束,路由授权仍由端点或门禁负责。
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| id | integer | false |
|
||||
| title | text | false |
|
||||
| slug | text | false |
|
||||
| summary | text | true |
|
||||
| content | text | true |
|
||||
| tag | text | true |
|
||||
| created_at | text | true |
|
||||
| updated_at | text | true |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [schema.tables.md](schema.tables.md#posts);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`schema`*
|
||||
完成后返回*[读取posts的实际 Markdown 常量](document.read_table(path="db/schema.tables.md", title="posts"))*.
|
||||
|
||||
## tags
|
||||
|
||||
标签表结构。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`tags` =
|
||||
标签结构保留显示名称与稳定 slug。显示文字可以改动,路由和文章主标签应继续引用稳定标识;唯一索引需要在正式迁移中明确声明。
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| id | integer | false |
|
||||
| name | text | false |
|
||||
| slug | text | false |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [schema.tables.md](schema.tables.md#tags);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`tags`*
|
||||
完成后返回*[读取tags的实际 Markdown 常量](document.read_table(path="db/schema.tables.md", title="tags"))*.
|
||||
|
||||
## post_tags
|
||||
|
||||
文章-标签关联表结构。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`post_tags` =
|
||||
关联结构保留文章与标签标识。种子关系依赖空数据库中预期的插入顺序;向已有用户库导入时应先映射真实 id,不能直接复用演示序号。
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| id | integer | false |
|
||||
| post_id | integer | false |
|
||||
| tag_id | integer | false |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [schema.tables.md](schema.tables.md#post_tags);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`post_tags`*
|
||||
完成后返回*[读取post_tags的实际 Markdown 常量](document.read_table(path="db/schema.tables.md", title="post_tags"))*.
|
||||
@@ -0,0 +1,38 @@
|
||||
# 博客表结构
|
||||
|
||||
这里保存原生字面 GFM 数据。调用函数通过 document.read_table 读取所选章节;不会执行本文件中的说明或示例。
|
||||
|
||||
## posts
|
||||
|
||||
文章结构保留 id、标题、slug、摘要、Markdown 正文、主标签和时间字段。slug 对应文章详情路由;可空声明控制存储约束,路由授权仍由端点或门禁负责。
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| id | integer | false |
|
||||
| title | text | false |
|
||||
| slug | text | false |
|
||||
| summary | text | true |
|
||||
| content | text | true |
|
||||
| tag | text | true |
|
||||
| created_at | text | true |
|
||||
| updated_at | text | true |
|
||||
|
||||
## tags
|
||||
|
||||
标签结构保留显示名称与稳定 slug。显示文字可以改动,路由和文章主标签应继续引用稳定标识;唯一索引需要在正式迁移中明确声明。
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| id | integer | false |
|
||||
| name | text | false |
|
||||
| slug | text | false |
|
||||
|
||||
## post_tags
|
||||
|
||||
关联结构保留文章与标签标识。种子关系依赖空数据库中预期的插入顺序;向已有用户库导入时应先映射真实 id,不能直接复用演示序号。
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|------|------|------|
|
||||
| id | integer | false |
|
||||
| post_id | integer | false |
|
||||
| tag_id | integer | false |
|
||||
@@ -1,57 +1,44 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: 博客演示种子调用手册
|
||||
import:
|
||||
document: lib/document.mq.md
|
||||
---
|
||||
|
||||
本文件负责可调用的说明与编排,[seed.tables.md](seed.tables.md)负责可独立阅读的 Markdown 常量。调用时把 --fs-root 指向 examples/marqdo-blog,读取需要 fs.read;连接数据库或编译样式时还需要 plugin。
|
||||
|
||||
## posts
|
||||
|
||||
种子文章。首页与详情页的初始数据。created_at 用于按时间倒序展示;tag 是主标签 slug。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`posts` =
|
||||
六篇演示文章覆盖文档、路由、原生集合、实时通信、会话和数据库。日期用于稳定排序,正文保持 Markdown 数据;这些常量不会自行写入数据库。
|
||||
|
||||
| 行 | title | slug | summary | content | tag | created_at | updated_at |
|
||||
|----|-------|------|---------|---------|-----|------------|------------|
|
||||
| 1 | 你好,Marqdo 博客 | hello-marqdo | 用 Marqdo 的 web 扩展库搭建的第一个博客。表格即组件、文档即代码。 | 这是一篇介绍博客系统的文章。它由 Marqdo 脚本在启动时写入 SQLite,通过 ext/web 的组件装配渲染成页面。 | marqdo | 2026-08-01 | 2026-08-02 |
|
||||
| 2 | 动态路由与文章详情 | dynamic-routing | 如何用 /post/{slug} 动态路由渲染单篇文章。 | 本文说明动态路由机制:作者面注册带 {slug} 占位符的路由,请求时把路径参数注入页面查询条件。 | web | 2026-08-05 | 2026-08-05 |
|
||||
| 3 | 用 GFM 表格表达数据 | gfm-tables | Marqdo 的字典操作不依赖 json 库,GFM 表格即可完成。 | 表格即数据、表格即组件。这篇文章展示如何在 .mq.md 里用横向表写种子数据,用脚注索引读取字段。 | tutorial | 2026-08-10 | 2026-08-11 |
|
||||
| 4 | WebSocket 实时小部件 | websocket-live | 给博客加一个实时回显的 WebSocket 端点。 | 通过 app.路由实时 注册 /live 端点,配合 public/live.js 在首页显示实时连接状态。 | realtime | 2026-08-15 | 2026-08-15 |
|
||||
| 5 | 会话与登录鉴权 | session-auth | 后台用 session 门禁保护,只有登录用户能发布文章。 | 用 app.鉴权 配置管理员用户表,/admin 下的 CRUD 页面都需要有效会话。 | web | 2026-08-18 | 2026-08-20 |
|
||||
| 6 | 数据库与 CRUD | database-crud | 博客的文章、标签、关联全部由 SQLite 支撑。 | db.初始化 建表、db.插入 写种子、后台表单增删改。文章与标签通过 post_tags 关联。 | database | 2026-08-20 | 2026-08-21 |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [seed.tables.md](seed.tables.md#posts);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`posts`*
|
||||
完成后返回*[读取posts的实际 Markdown 常量](document.read_table(path="db/seed.tables.md", title="posts"))*.
|
||||
|
||||
## tags
|
||||
|
||||
种子标签。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`tags` =
|
||||
演示标签保留原始顺序与 slug,便于在独立空库中验证文章关联。读取这些行没有插入或删除效果;现有用户标签应由显式迁移管理。
|
||||
|
||||
| 行 | name | slug |
|
||||
|----|------|------|
|
||||
| 1 | Marqdo | marqdo |
|
||||
| 2 | Web | web |
|
||||
| 3 | 教程 | tutorial |
|
||||
| 4 | 数据库 | database |
|
||||
| 5 | 实时 | realtime |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [seed.tables.md](seed.tables.md#tags);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`tags`*
|
||||
完成后返回*[读取tags的实际 Markdown 常量](document.read_table(path="db/seed.tables.md", title="tags"))*.
|
||||
|
||||
## post_tags
|
||||
|
||||
种子文章-标签关联。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`post_tags` =
|
||||
关联行保持文章与标签的演示对应关系。它们适用于按同一顺序初始化的空库;已有数据需要重新映射 id,读取函数不会清空或重建任何表。
|
||||
|
||||
| 行 | post_id | tag_id |
|
||||
|----|---------|--------|
|
||||
| 1 | 1 | 1 |
|
||||
| 2 | 1 | 2 |
|
||||
| 3 | 2 | 2 |
|
||||
| 4 | 3 | 1 |
|
||||
| 5 | 3 | 3 |
|
||||
| 6 | 4 | 5 |
|
||||
| 7 | 4 | 2 |
|
||||
| 8 | 5 | 2 |
|
||||
| 9 | 6 | 4 |
|
||||
| 10 | 6 | 1 |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [seed.tables.md](seed.tables.md#post_tags);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`post_tags`*
|
||||
完成后返回*[读取post_tags的实际 Markdown 常量](document.read_table(path="db/seed.tables.md", title="post_tags"))*.
|
||||
@@ -0,0 +1,45 @@
|
||||
# 博客演示种子
|
||||
|
||||
这里保存原生字面 GFM 数据。调用函数通过 document.read_table 读取所选章节;不会执行本文件中的说明或示例。
|
||||
|
||||
## posts
|
||||
|
||||
六篇演示文章覆盖文档、路由、原生集合、实时通信、会话和数据库。日期用于稳定排序,正文保持 Markdown 数据;这些常量不会自行写入数据库。
|
||||
|
||||
| 行 | title | slug | summary | content | tag | created_at | updated_at |
|
||||
|----|-------|------|---------|---------|-----|------------|------------|
|
||||
| 1 | 你好,Marqdo 博客 | hello-marqdo | 用 Marqdo 的 web 扩展库搭建的第一个博客。表格即组件、文档即代码。 | 这是一篇介绍博客系统的文章。它由 Marqdo 脚本在启动时写入 SQLite,通过 ext/web 的组件装配渲染成页面。 | marqdo | 2026-08-01 | 2026-08-02 |
|
||||
| 2 | 动态路由与文章详情 | dynamic-routing | 如何用 /post/{slug} 动态路由渲染单篇文章。 | 本文说明动态路由机制:作者面注册带 {slug} 占位符的路由,请求时把路径参数注入页面查询条件。 | web | 2026-08-05 | 2026-08-05 |
|
||||
| 3 | 用 GFM 表格表达数据 | gfm-tables | Marqdo 的字典操作不依赖 json 库,GFM 表格即可完成。 | 表格即数据、表格即组件。这篇文章展示如何在 .mq.md 里用横向表写种子数据,用脚注索引读取字段。 | tutorial | 2026-08-10 | 2026-08-11 |
|
||||
| 4 | WebSocket 实时小部件 | websocket-live | 给博客加一个实时回显的 WebSocket 端点。 | 通过 app.路由实时 注册 /live 端点,配合 public/live.js 在首页显示实时连接状态。 | realtime | 2026-08-15 | 2026-08-15 |
|
||||
| 5 | 会话与登录鉴权 | session-auth | 后台用 session 门禁保护,只有登录用户能发布文章。 | 用 app.鉴权 配置管理员用户表,/admin 下的 CRUD 页面都需要有效会话。 | web | 2026-08-18 | 2026-08-20 |
|
||||
| 6 | 数据库与 CRUD | database-crud | 博客的文章、标签、关联全部由 SQLite 支撑。 | db.初始化 建表、db.插入 写种子、后台表单增删改。文章与标签通过 post_tags 关联。 | database | 2026-08-20 | 2026-08-21 |
|
||||
|
||||
## tags
|
||||
|
||||
演示标签保留原始顺序与 slug,便于在独立空库中验证文章关联。读取这些行没有插入或删除效果;现有用户标签应由显式迁移管理。
|
||||
|
||||
| 行 | name | slug |
|
||||
|----|------|------|
|
||||
| 1 | Marqdo | marqdo |
|
||||
| 2 | Web | web |
|
||||
| 3 | 教程 | tutorial |
|
||||
| 4 | 数据库 | database |
|
||||
| 5 | 实时 | realtime |
|
||||
|
||||
## post_tags
|
||||
|
||||
关联行保持文章与标签的演示对应关系。它们适用于按同一顺序初始化的空库;已有数据需要重新映射 id,读取函数不会清空或重建任何表。
|
||||
|
||||
| 行 | post_id | tag_id |
|
||||
|----|---------|--------|
|
||||
| 1 | 1 | 1 |
|
||||
| 2 | 1 | 2 |
|
||||
| 3 | 2 | 2 |
|
||||
| 4 | 3 | 1 |
|
||||
| 5 | 3 | 3 |
|
||||
| 6 | 4 | 5 |
|
||||
| 7 | 4 | 2 |
|
||||
| 8 | 5 | 2 |
|
||||
| 9 | 6 | 4 |
|
||||
| 10 | 6 | 1 |
|
||||
@@ -8,4 +8,5 @@ markup: occlusion
|
||||
|
||||
# 关于 Marqdo
|
||||
|
||||
|
||||
Marqdo 是可执行文档语言:文档即程序,程序即知识。
|
||||
@@ -1,13 +1,28 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: marqdo-blog serve
|
||||
description: Scan Artifact documents/endpoints and listen (ADR 0007).
|
||||
title: Callable Artifact blog launcher
|
||||
import:
|
||||
web: ext/web/web.mq.md
|
||||
posts: db/posts.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
This launcher starts the ordinary Markdown/data-source Documents and declared JSON Endpoints. It owns data preparation and listener lifetime; the index remains readable page content. From the checkout use marqdo call examples/marqdo-blog/serve.mq.md main with --effects plugin,fs.write,network.write and --fs-root examples/marqdo-blog.
|
||||
|
||||
**store = > posts.open url="sqlite:data/blog.db"**
|
||||
> web.serve root="." host="127.0.0.1" port=18081 db=`store` static_dir="public"
|
||||
## main
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| root | text | "examples/marqdo-blog" | Explicit discovery root relative to the checkout |
|
||||
| port | number | 18081 | Local loopback listen port |
|
||||
| url | any | None | None uses the retained site-root database; tests supply an owned URI |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | map | Blocking listener after database preparation and declared-route discovery |
|
||||
|
||||
Use `root`="examples/marqdo-blog", `port`=18081 and `url`=None from the checkout. The ordinary callable heading makes this workflow available through call, while Document bodies remain Markdown. Native filesystem resolution keeps SQLite under the actual granted site root, independently of the terminal working directory. Existing articles are retained and only an empty table receives demonstration rows.
|
||||
|
||||
Discovery follows the actual route metadata for Home, About, slug detail, Ping and Echo. Ordinary Documents keep their existing request-time data-source behavior. Starting this workflow is an explicit local network action, not a side effect of reading a library. The listener blocks until the supervising caller stops the process; no detached daemon or database reset is implied.
|
||||
|
||||
We **store = [Prepare the retained current blog data](posts.open(url=`url`))**.
|
||||
Return *[Discover and listen with the actual site context](web.serve(root=`root`, host="127.0.0.1", port=`port`, db=`store`, static_dir="public"))*.
|
||||
@@ -1,407 +1,149 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: styles/theme
|
||||
description: 博客主题:样式即数据表格,装配即函数。
|
||||
title: 博客主题字面样式调用手册
|
||||
import:
|
||||
网页: ext/web/网页.mq.md
|
||||
document: lib/document.mq.md
|
||||
web: ext/web/web.mq.md
|
||||
text: lib/text.mq.md
|
||||
table: lib/table.mq.md
|
||||
---
|
||||
|
||||
博客主题的样式即数据表格:每个 `## 段` 导出一张 GFM 样式表(`|选择器|属性|值|`,
|
||||
或用 `|媒体|选择器|属性|值|` 表达响应式),`## 全局` 用 `样式装配` 函数把它们
|
||||
装配成一份完整 CSS。这符合 文档即代码 —— 样式是可读的表格,装配是显式调用。
|
||||
本文件负责可调用的说明与编排,[theme.tables.md](theme.tables.md)负责可独立阅读的 Markdown 常量。调用时把 --fs-root 指向 examples/marqdo-blog,读取需要 fs.read;连接数据库或编译样式时还需要 plugin。
|
||||
|
||||
## 基础
|
||||
|
||||
配色与字体变量、页面骨架。衬线标题 + 无衬线正文,暖白纸感背景。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`基础` =
|
||||
基础段声明纸张、文字和强调色变量,以及字体与页面骨架。返回值仍是原生样式表数据,编译与浏览器加载由各自的明确步骤完成。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| :root | --ink | #1c1917 |
|
||||
| :root | --ink-soft | #44403c |
|
||||
| :root | --muted | #78716c |
|
||||
| :root | --faint | #a8a29e |
|
||||
| :root | --paper | #f7f5f2 |
|
||||
| :root | --card | #ffffff |
|
||||
| :root | --line | #e7e5e4 |
|
||||
| :root | --accent | #4f46e5 |
|
||||
| :root | --accent-2 | #7c3aed |
|
||||
| :root | --accent-ink | #ffffff |
|
||||
| :root | --radius | 16px |
|
||||
| :root | --shadow | 0 1px 2px rgba(28,25,23,.05), 0 8px 24px rgba(28,25,23,.06) |
|
||||
| :root | --shadow-lg | 0 4px 12px rgba(28,25,23,.08), 0 20px 48px rgba(28,25,23,.12) |
|
||||
| :root | --serif | "Noto Serif SC", Georgia, "Songti SC", serif |
|
||||
| :root | --sans | "Noto Sans SC", "IBM Plex Sans", system-ui, -apple-system, sans-serif |
|
||||
| html | scroll-behavior | smooth |
|
||||
| * | box-sizing | border-box |
|
||||
| ::selection | background | rgba(79,70,229,.18) |
|
||||
| body | margin | 0 |
|
||||
| body | font-family | var(--sans) |
|
||||
| body | background | var(--paper) |
|
||||
| body | color | var(--ink) |
|
||||
| body | display | grid |
|
||||
| body | min-height | 100vh |
|
||||
| body | line-height | 1.7 |
|
||||
| body | grid-template-rows | auto 1fr auto |
|
||||
| body.has-sidebar | grid-template-columns | 15rem 1fr |
|
||||
| body.has-sidebar | grid-template-areas | "top top" "side main" "foot foot" |
|
||||
| body.no-sidebar | grid-template-areas | "top" "main" "foot" |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [theme.tables.md](theme.tables.md#基础);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`基础`*
|
||||
完成后返回*[读取基础的实际 Markdown 常量](document.read_table(path="styles/theme.tables.md", title="基础"))*.
|
||||
|
||||
## 顶栏
|
||||
|
||||
吸顶导航:磨砂玻璃 + 细分隔线,Logo 处用渐变强调。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`顶栏` =
|
||||
顶栏段保留吸顶导航、磨砂背景、品牌渐变与链接状态。选择器与值都位于数据叶子,调用函数说明用途,避免把整套声明堆进执行流程。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| header.topnav | grid-area | top |
|
||||
| header.topnav | position | sticky |
|
||||
| header.topnav | top | 0 |
|
||||
| header.topnav | z-index | 20 |
|
||||
| header.topnav | background | rgba(255,255,255,.82) |
|
||||
| header.topnav | backdrop-filter | blur(10px) |
|
||||
| header.topnav | -webkit-backdrop-filter | blur(10px) |
|
||||
| header.topnav | border-bottom | 1px solid var(--line) |
|
||||
| header.topnav | padding | .9rem 2rem |
|
||||
| header.topnav | display | flex |
|
||||
| header.topnav | align-items | center |
|
||||
| header.topnav | justify-content | space-between |
|
||||
| ul.nav | list-style | none |
|
||||
| ul.nav | margin | 0 |
|
||||
| ul.nav | padding | 0 |
|
||||
| ul.nav | display | flex |
|
||||
| ul.nav | align-items | center |
|
||||
| ul.nav | gap | .35rem |
|
||||
| ul.nav li | margin | 0 |
|
||||
| ul.nav a | display | inline-block |
|
||||
| ul.nav a | padding | .45rem .9rem |
|
||||
| ul.nav a | border-radius | 999px |
|
||||
| ul.nav a | color | var(--ink-soft) |
|
||||
| ul.nav a | font-weight | 500 |
|
||||
| ul.nav a | text-decoration | none |
|
||||
| ul.nav a | transition | background .18s ease, color .18s ease |
|
||||
| ul.nav a:hover | background | rgba(79,70,229,.1) |
|
||||
| ul.nav a:hover | color | var(--accent) |
|
||||
| ul.nav li:first-child a | font-family | var(--serif) |
|
||||
| ul.nav li:first-child a | font-size | 1.25rem |
|
||||
| ul.nav li:first-child a | font-weight | 700 |
|
||||
| ul.nav li:first-child a | background | linear-gradient(120deg, var(--accent), var(--accent-2)) |
|
||||
| ul.nav li:first-child a | -webkit-background-clip | text |
|
||||
| ul.nav li:first-child a | background-clip | text |
|
||||
| ul.nav li:first-child a | -webkit-text-fill-color | transparent |
|
||||
| ul.nav li:first-child a | color | transparent |
|
||||
| ul.nav li:first-child a | padding-left | .2rem |
|
||||
| ul.nav li:first-child a | padding-right | .2rem |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [theme.tables.md](theme.tables.md#顶栏);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`顶栏`*
|
||||
完成后返回*[读取顶栏的实际 Markdown 常量](document.read_table(path="styles/theme.tables.md", title="顶栏"))*.
|
||||
|
||||
## 侧栏
|
||||
|
||||
归档面板:浅底圆角卡片,链接胶囊化。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`侧栏` =
|
||||
侧栏段保留归档面板的布局、链接间距和悬停反馈。它只提供样式数据,具体侧栏内容仍由独立组件或 Document 负责。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| aside.side | grid-area | side |
|
||||
| aside.side | padding | 2rem 1.25rem |
|
||||
| aside.side | border-right | 1px solid var(--line) |
|
||||
| aside.side | background | linear-gradient(180deg, #fbfaf8, #f3f1ec) |
|
||||
| ul.side-nav | list-style | none |
|
||||
| ul.side-nav | margin | 0 |
|
||||
| ul.side-nav | padding | 0 |
|
||||
| ul.side-nav | display | flex |
|
||||
| ul.side-nav | flex-direction | column |
|
||||
| ul.side-nav | gap | .25rem |
|
||||
| ul.side-nav li | margin | 0 |
|
||||
| ul.side-nav a | display | block |
|
||||
| ul.side-nav a | padding | .55rem .85rem |
|
||||
| ul.side-nav a | border-radius | 10px |
|
||||
| ul.side-nav a | color | var(--ink-soft) |
|
||||
| ul.side-nav a | text-decoration | none |
|
||||
| ul.side-nav a | font-weight | 500 |
|
||||
| ul.side-nav a | transition | background .15s ease, transform .15s ease, color .15s ease |
|
||||
| ul.side-nav a:hover | background | #fff |
|
||||
| ul.side-nav a:hover | color | var(--accent) |
|
||||
| ul.side-nav a:hover | transform | translateX(4px) |
|
||||
| ul.side-nav a:hover | box-shadow | 0 1px 3px rgba(28,25,23,.08) |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [theme.tables.md](theme.tables.md#侧栏);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`侧栏`*
|
||||
完成后返回*[读取侧栏的实际 Markdown 常量](document.read_table(path="styles/theme.tables.md", title="侧栏"))*.
|
||||
|
||||
## 主体
|
||||
|
||||
内容区留白与节奏。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`主体` =
|
||||
主体段定义内容区留白、标题和导语的排版节奏。数据读取保持原有字段和值;主题编译不会替页面构造布局节点。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| main.main | grid-area | main |
|
||||
| main.main | padding | 2.5rem 2.5rem 3.5rem |
|
||||
| main.main | max-width | 76rem |
|
||||
| main.main | width | 100% |
|
||||
| .main-intro | margin-bottom | .5rem |
|
||||
| .main-intro h1 | font-family | var(--serif) |
|
||||
| .main-intro h1 | margin | 0 0 .5rem |
|
||||
| .main-intro h1 | font-size | clamp(2rem, 5vw, 2.9rem) |
|
||||
| .main-intro h1 | line-height | 1.2 |
|
||||
| .main-intro h1 | font-weight | 700 |
|
||||
| .main-intro h1 | letter-spacing | -.01em |
|
||||
| .main-intro p | color | var(--muted) |
|
||||
| .main-intro p | margin | 0 |
|
||||
| .main-intro p | font-size | 1.05rem |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [theme.tables.md](theme.tables.md#主体);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`主体`*
|
||||
完成后返回*[读取主体的实际 Markdown 常量](document.read_table(path="styles/theme.tables.md", title="主体"))*.
|
||||
|
||||
## 卡片
|
||||
|
||||
文章卡片:白底大圆角、柔和阴影、hover 抬升,整卡可点。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`卡片` =
|
||||
卡片段保留文章列表的网格、阴影、封面和悬停状态。样式类名应与页面输出保持一致;此函数只读取声明,不查询文章数据。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| .content.cards | display | grid |
|
||||
| .content.cards | gap | 1.5rem |
|
||||
| .content.cards | margin-top | 2rem |
|
||||
| .content.cards | grid-template-columns | repeat(auto-fill, minmax(17rem, 1fr)) |
|
||||
| .content.cards article.card | background | var(--card) |
|
||||
| .content.cards article.card | border | 1px solid var(--line) |
|
||||
| .content.cards article.card | border-radius | var(--radius) |
|
||||
| .content.cards article.card | padding | 1.6rem 1.7rem |
|
||||
| .content.cards article.card | box-shadow | var(--shadow) |
|
||||
| .content.cards article.card | transition | transform .22s ease, box-shadow .22s ease, border-color .22s ease |
|
||||
| .content.cards article.card | display | flex |
|
||||
| .content.cards article.card | flex-direction | column |
|
||||
| .content.cards article.card | gap | .55rem |
|
||||
| .content.cards article.card:hover | transform | translateY(-6px) |
|
||||
| .content.cards article.card:hover | box-shadow | var(--shadow-lg) |
|
||||
| .content.cards article.card:hover | border-color | rgba(79,70,229,.35) |
|
||||
| .content.cards a.card-link | text-decoration | none |
|
||||
| .content.cards a.card-link | color | inherit |
|
||||
| .content.cards a.card-link | display | flex |
|
||||
| .content.cards a.card-link | flex-direction | column |
|
||||
| .content.cards a.card-link | gap | .55rem |
|
||||
| .content.cards a.card-link | height | 100% |
|
||||
| .content.cards a.card-link:hover | color | inherit |
|
||||
| .content.cards h2 | font-family | var(--serif) |
|
||||
| .content.cards h2 | margin | 0 |
|
||||
| .content.cards h2 | font-size | 1.35rem |
|
||||
| .content.cards h2 | line-height | 1.35 |
|
||||
| .content.cards h2 | font-weight | 700 |
|
||||
| .content.cards h2 | transition | color .18s ease |
|
||||
| .content.cards a.card-link:hover h2 | color | var(--accent) |
|
||||
| .card-meta | font-size | .82rem |
|
||||
| .card-meta | color | var(--faint) |
|
||||
| .card-meta | letter-spacing | .04em |
|
||||
| .card-meta | text-transform | uppercase |
|
||||
| .card-tag | align-self | flex-start |
|
||||
| .card-tag | font-size | .78rem |
|
||||
| .card-tag | color | var(--accent) |
|
||||
| .card-tag | background | rgba(79,70,229,.08) |
|
||||
| .card-tag | padding | .15rem .65rem |
|
||||
| .card-tag | border-radius | 999px |
|
||||
| .card-tag | font-weight | 600 |
|
||||
| .content.cards p | color | var(--muted) |
|
||||
| .content.cards p | margin | 0 |
|
||||
| .content.cards p | font-size | .95rem |
|
||||
| .content.cards p | flex | 1 |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [theme.tables.md](theme.tables.md#卡片);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`卡片`*
|
||||
完成后返回*[读取卡片的实际 Markdown 常量](document.read_table(path="styles/theme.tables.md", title="卡片"))*.
|
||||
|
||||
## 页脚
|
||||
|
||||
`页脚` =
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| footer.foot | grid-area | foot |
|
||||
| footer.foot | padding | 1.4rem 2rem |
|
||||
| footer.foot | border-top | 1px solid var(--line) |
|
||||
| footer.foot | color | var(--muted) |
|
||||
| footer.foot | background | #fff |
|
||||
| footer.foot | font-size | .9rem |
|
||||
| footer.foot | display | flex |
|
||||
| footer.foot | justify-content | space-between |
|
||||
| footer.foot | align-items | center |
|
||||
| footer.foot | flex-wrap | wrap |
|
||||
| footer.foot | gap | .5rem |
|
||||
| ul.foot-nav | list-style | none |
|
||||
| ul.foot-nav | margin | 0 |
|
||||
| ul.foot-nav | padding | 0 |
|
||||
| ul.foot-nav | display | flex |
|
||||
| ul.foot-nav | gap | 1rem |
|
||||
| ul.foot-nav | flex-wrap | wrap |
|
||||
| ul.foot-nav li | margin | 0 |
|
||||
| ul.foot-nav a | color | var(--muted) |
|
||||
| ul.foot-nav a | text-decoration | none |
|
||||
| ul.foot-nav a:hover | color | var(--accent) |
|
||||
页脚段保留页面末尾的留白、分隔线和链接外观。页脚若分为多个布局区域,仍应沿组件目录拆分,样式声明不会代替工程结构。
|
||||
|
||||
*`页脚`*
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [theme.tables.md](theme.tables.md#页脚);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
完成后返回*[读取页脚的实际 Markdown 常量](document.read_table(path="styles/theme.tables.md", title="页脚"))*.
|
||||
|
||||
## 表单
|
||||
|
||||
后台表单统一风格。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`表单` =
|
||||
表单段保留输入控件、按钮和管理操作的状态样式。字段校验、保存和鉴权属于数据与安全资源;样式只改变已存在控件的外观。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| .site-form | margin-top | 1.75rem |
|
||||
| .site-form | max-width | 34rem |
|
||||
| .site-form | background | var(--card) |
|
||||
| .site-form | border | 1px solid var(--line) |
|
||||
| .site-form | border-radius | var(--radius) |
|
||||
| .site-form | padding | 1.8rem |
|
||||
| .site-form | box-shadow | var(--shadow) |
|
||||
| .site-form form | display | grid |
|
||||
| .site-form form | gap | 1rem |
|
||||
| .site-form label | display | grid |
|
||||
| .site-form label | gap | .35rem |
|
||||
| .site-form label | font-size | .92rem |
|
||||
| .site-form label | font-weight | 600 |
|
||||
| .site-form label | color | var(--ink-soft) |
|
||||
| .site-form input | padding | .65rem .8rem |
|
||||
| .site-form input | border | 1px solid var(--line) |
|
||||
| .site-form input | border-radius | 10px |
|
||||
| .site-form input | font | inherit |
|
||||
| .site-form input | background | #fdfcfb |
|
||||
| .site-form input | transition | border-color .15s ease, box-shadow .15s ease |
|
||||
| .site-form textarea | padding | .65rem .8rem |
|
||||
| .site-form textarea | border | 1px solid var(--line) |
|
||||
| .site-form textarea | border-radius | 10px |
|
||||
| .site-form textarea | font | inherit |
|
||||
| .site-form textarea | background | #fdfcfb |
|
||||
| .site-form textarea | transition | border-color .15s ease, box-shadow .15s ease |
|
||||
| .site-form select | padding | .65rem .8rem |
|
||||
| .site-form select | border | 1px solid var(--line) |
|
||||
| .site-form select | border-radius | 10px |
|
||||
| .site-form select | font | inherit |
|
||||
| .site-form select | background | #fdfcfb |
|
||||
| .site-form select | transition | border-color .15s ease, box-shadow .15s ease |
|
||||
| .site-form input:focus | outline | none |
|
||||
| .site-form input:focus | border-color | var(--accent) |
|
||||
| .site-form input:focus | box-shadow | 0 0 0 3px rgba(79,70,229,.12) |
|
||||
| .site-form textarea:focus | outline | none |
|
||||
| .site-form textarea:focus | border-color | var(--accent) |
|
||||
| .site-form textarea:focus | box-shadow | 0 0 0 3px rgba(79,70,229,.12) |
|
||||
| .site-form select:focus | outline | none |
|
||||
| .site-form select:focus | border-color | var(--accent) |
|
||||
| .site-form select:focus | box-shadow | 0 0 0 3px rgba(79,70,229,.12) |
|
||||
| .site-form input[readonly] | background | #f5f5f4 |
|
||||
| .site-form input[readonly] | color | var(--muted) |
|
||||
| .site-form textarea | min-height | 10rem |
|
||||
| .site-form textarea | resize | vertical |
|
||||
| .site-form .err | color | #b91c1c |
|
||||
| .site-form .err | font-size | .85rem |
|
||||
| .site-form .actions | display | flex |
|
||||
| .site-form .actions | gap | .75rem |
|
||||
| .site-form .actions | align-items | center |
|
||||
| .site-form .actions | flex-wrap | wrap |
|
||||
| .site-form .actions | padding-top | .25rem |
|
||||
| .site-form button | background | linear-gradient(120deg, var(--accent), var(--accent-2)) |
|
||||
| .site-form button | color | var(--accent-ink) |
|
||||
| .site-form button | border | 0 |
|
||||
| .site-form button | padding | .6rem 1.3rem |
|
||||
| .site-form button | border-radius | 999px |
|
||||
| .site-form button | cursor | pointer |
|
||||
| .site-form button | font-weight | 600 |
|
||||
| .site-form button | font-size | .95rem |
|
||||
| .site-form button | transition | opacity .15s ease, transform .15s ease, box-shadow .15s ease |
|
||||
| .site-form button:hover | opacity | .92 |
|
||||
| .site-form button:hover | transform | translateY(-1px) |
|
||||
| .site-form button:hover | box-shadow | 0 6px 18px rgba(79,70,229,.3) |
|
||||
| .site-form a.btn | display | inline-block |
|
||||
| .site-form a.btn | padding | .6rem 1.3rem |
|
||||
| .site-form a.btn | border-radius | 999px |
|
||||
| .site-form a.btn | border | 1px solid var(--line) |
|
||||
| .site-form a.btn | color | var(--ink-soft) |
|
||||
| .site-form a.btn | text-decoration | none |
|
||||
| .site-form a.btn | font-weight | 500 |
|
||||
| .site-form a.btn | font-size | .95rem |
|
||||
| .site-form .meta | color | var(--muted) |
|
||||
| .site-form .meta | font-size | .9rem |
|
||||
| .site-form .admin-list | margin | 0 |
|
||||
| .site-form .admin-list | padding | 0 |
|
||||
| .site-form .admin-list | list-style | none |
|
||||
| .site-form .admin-list | display | grid |
|
||||
| .site-form .admin-list | gap | .5rem |
|
||||
| .site-form .admin-list li | background | #fdfcfb |
|
||||
| .site-form .admin-list li | border | 1px solid var(--line) |
|
||||
| .site-form .admin-list li | border-radius | 10px |
|
||||
| .site-form .admin-list li | padding | .6rem .9rem |
|
||||
| .site-form .admin-list li | display | flex |
|
||||
| .site-form .admin-list li | justify-content | space-between |
|
||||
| .site-form .admin-list li | align-items | center |
|
||||
| .site-form .admin-list li | gap | 1rem |
|
||||
| .site-form .admin-list a | color | var(--accent) |
|
||||
| .site-form .admin-list a | text-decoration | none |
|
||||
| .site-form .admin-list a | font-size | .9rem |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [theme.tables.md](theme.tables.md#表单);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
*`表单`*
|
||||
完成后返回*[读取表单的实际 Markdown 常量](document.read_table(path="styles/theme.tables.md", title="表单"))*.
|
||||
|
||||
## 响应式
|
||||
|
||||
窄屏收为单栏,导航换行。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | 与原字面表一致的数据类型和记录/列式形态 |
|
||||
|
||||
`响应式` =
|
||||
响应式段保留窄屏断点、侧栏流向、内容间距和列表列数。媒体条件仍由原生样式编译器读取,浏览器结果需要实际窄屏验证。
|
||||
|
||||
| 媒体 | 选择器 | 属性 | 值 |
|
||||
|------|--------|------|-----|
|
||||
| (max-width: 860px) | body.has-sidebar | grid-template-columns | 1fr |
|
||||
| (max-width: 860px) | body.has-sidebar | grid-template-areas | "top" "main" "side" "foot" |
|
||||
| (max-width: 860px) | aside.side | border-right | 0 |
|
||||
| (max-width: 860px) | aside.side | border-bottom | 1px solid var(--line) |
|
||||
| (max-width: 860px) | aside.side | padding | 1rem 2rem |
|
||||
| (max-width: 860px) | ul.side-nav | flex-direction | row |
|
||||
| (max-width: 860px) | ul.side-nav | flex-wrap | wrap |
|
||||
| (max-width: 860px) | main.main | padding | 1.75rem 1.25rem 2.5rem |
|
||||
| (max-width: 860px) | header.topnav | padding | .75rem 1.25rem |
|
||||
| (max-width: 860px) | footer.foot | padding | 1.2rem 1.25rem |
|
||||
| (max-width: 860px) | .content.cards | grid-template-columns | 1fr |
|
||||
| (max-width: 520px) | ul.nav | flex-wrap | wrap |
|
||||
从站点根目录授予 fs.read 后调用。实际常量位于 [theme.tables.md](theme.tables.md#响应式);读取过程保留数值、布尔、空值和表格形态,并检查标题与行列结构。数据文件中的说明不会作为程序运行。
|
||||
|
||||
完成后返回*[读取响应式的实际 Markdown 常量](document.read_table(path="styles/theme.tables.md", title="响应式"))*.
|
||||
|
||||
## _编译段
|
||||
|
||||
| 参数 | 类型 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| 名称 | text | 必填 | theme.tables.md 中精确且唯一的样式章节名 |
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | text | 由所选样式声明编译的 CSS |
|
||||
|
||||
使用`名称`选择一个具有独立职责的声明段,授权 fs.read 和 plugin。字面表读取保留原始选择器、属性和值,原生样式编译器负责媒体条件及 CSS 单元格处理。标题错误会保留文档诊断;此步骤不写文件,也不会把样式附加到浏览器。
|
||||
|
||||
我们 **数据 = [读取这一段的实际样式常量](document.read_table(path="styles/theme.tables.md", title=`名称`))**。
|
||||
完成后返回*[编译所选声明段](web.make_style(name=`名称`, table=`数据`))*.
|
||||
|
||||
*`响应式`*
|
||||
|
||||
## 全局
|
||||
|
||||
用 样式装配 函数逐个把段落表装配成 CSS,再拼接成完整样式表。
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | text | 全部声明段按稳定顺序编译的 CSS 文本 |
|
||||
|
||||
**基础表 = > 基础**
|
||||
**顶栏表 = > 顶栏**
|
||||
**侧栏表 = > 侧栏**
|
||||
**主体表 = > 主体**
|
||||
**卡片表 = > 卡片**
|
||||
**页脚表 = > 页脚**
|
||||
**表单表 = > 表单**
|
||||
**响应式表 = > 响应式**
|
||||
从站点根授权 fs.read 与 plugin 后调用。名称表保留基础、导航、侧栏、主体、卡片、页脚、表单和断点的原有顺序;每段通过同一编译步骤读取自己的 Markdown 常量。变量声明因此先于使用它们的组件规则,响应式覆盖放在最后。返回值仍是 CSS 文本,保存与资源引用由明确的后续步骤完成。各命名数据函数也继续保留,方便独立检查某个区域。
|
||||
|
||||
**css基础 = > 网页.样式装配 名="基础" 表=`基础表`**
|
||||
**css顶栏 = > 网页.样式装配 名="顶栏" 表=`顶栏表`**
|
||||
**css侧栏 = > 网页.样式装配 名="侧栏" 表=`侧栏表`**
|
||||
**css主体 = > 网页.样式装配 名="主体" 表=`主体表`**
|
||||
**css卡片 = > 网页.样式装配 名="卡片" 表=`卡片表`**
|
||||
**css页脚 = > 网页.样式装配 名="页脚" 表=`页脚表`**
|
||||
**css表单 = > 网页.样式装配 名="表单" 表=`表单表`**
|
||||
**css响应式 = > 网页.样式装配 名="响应式" 表=`响应式表`**
|
||||
`names` =
|
||||
|
||||
`css段` =
|
||||
| 名称 |
|
||||
|---|
|
||||
| 基础 |
|
||||
| 顶栏 |
|
||||
| 侧栏 |
|
||||
| 主体 |
|
||||
| 卡片 |
|
||||
| 页脚 |
|
||||
| 表单 |
|
||||
| 响应式 |
|
||||
|
||||
| css |
|
||||
|-----|
|
||||
| `css基础` |
|
||||
| `css顶栏` |
|
||||
| `css侧栏` |
|
||||
| `css主体` |
|
||||
| `css卡片` |
|
||||
| `css页脚` |
|
||||
| `css表单` |
|
||||
| `css响应式` |
|
||||
|
||||
**css = > text.str_join xs=`css段` sep=""**
|
||||
*css*
|
||||
我们 **parts = [开始有序的 CSS 段列表](table.empty_list())**。
|
||||
- [依次编译每个独立声明段](for names as name)
|
||||
我们 **css = [编译当前区域](_编译段(名称=`name`))**,并 **parts = [保留覆盖顺序](table.append(list=`parts`, item=`css`))**。
|
||||
完成后返回*[按区域顺序连接 CSS](text.str_join(xs=`parts`, sep="\n"))*.
|
||||
@@ -0,0 +1,330 @@
|
||||
# 博客主题字面样式
|
||||
|
||||
这里保存原生字面 GFM 数据。调用函数通过 document.read_table 读取所选章节;不会执行本文件中的说明或示例。
|
||||
|
||||
## 基础
|
||||
|
||||
基础段声明纸张、文字和强调色变量,以及字体与页面骨架。返回值仍是原生样式表数据,编译与浏览器加载由各自的明确步骤完成。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| :root | --ink | #1c1917 |
|
||||
| :root | --ink-soft | #44403c |
|
||||
| :root | --muted | #78716c |
|
||||
| :root | --faint | #a8a29e |
|
||||
| :root | --paper | #f7f5f2 |
|
||||
| :root | --card | #ffffff |
|
||||
| :root | --line | #e7e5e4 |
|
||||
| :root | --accent | #4f46e5 |
|
||||
| :root | --accent-2 | #7c3aed |
|
||||
| :root | --accent-ink | #ffffff |
|
||||
| :root | --radius | 16px |
|
||||
| :root | --shadow | 0 1px 2px rgba(28,25,23,.05), 0 8px 24px rgba(28,25,23,.06) |
|
||||
| :root | --shadow-lg | 0 4px 12px rgba(28,25,23,.08), 0 20px 48px rgba(28,25,23,.12) |
|
||||
| :root | --serif | "Noto Serif SC", Georgia, "Songti SC", serif |
|
||||
| :root | --sans | "Noto Sans SC", "IBM Plex Sans", system-ui, -apple-system, sans-serif |
|
||||
| html | scroll-behavior | smooth |
|
||||
| * | box-sizing | border-box |
|
||||
| ::selection | background | rgba(79,70,229,.18) |
|
||||
| body | margin | 0 |
|
||||
| body | font-family | var(--sans) |
|
||||
| body | background | var(--paper) |
|
||||
| body | color | var(--ink) |
|
||||
| body | display | grid |
|
||||
| body | min-height | 100vh |
|
||||
| body | line-height | 1.7 |
|
||||
| body | grid-template-rows | auto 1fr auto |
|
||||
| body.has-sidebar | grid-template-columns | 15rem 1fr |
|
||||
| body.has-sidebar | grid-template-areas | "top top" "side main" "foot foot" |
|
||||
| body.no-sidebar | grid-template-areas | "top" "main" "foot" |
|
||||
|
||||
## 顶栏
|
||||
|
||||
顶栏段保留吸顶导航、磨砂背景、品牌渐变与链接状态。选择器与值都位于数据叶子,调用函数说明用途,避免把整套声明堆进执行流程。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| header.topnav | grid-area | top |
|
||||
| header.topnav | position | sticky |
|
||||
| header.topnav | top | 0 |
|
||||
| header.topnav | z-index | 20 |
|
||||
| header.topnav | background | rgba(255,255,255,.82) |
|
||||
| header.topnav | backdrop-filter | blur(10px) |
|
||||
| header.topnav | -webkit-backdrop-filter | blur(10px) |
|
||||
| header.topnav | border-bottom | 1px solid var(--line) |
|
||||
| header.topnav | padding | .9rem 2rem |
|
||||
| header.topnav | display | flex |
|
||||
| header.topnav | align-items | center |
|
||||
| header.topnav | justify-content | space-between |
|
||||
| ul.nav | list-style | none |
|
||||
| ul.nav | margin | 0 |
|
||||
| ul.nav | padding | 0 |
|
||||
| ul.nav | display | flex |
|
||||
| ul.nav | align-items | center |
|
||||
| ul.nav | gap | .35rem |
|
||||
| ul.nav li | margin | 0 |
|
||||
| ul.nav a | display | inline-block |
|
||||
| ul.nav a | padding | .45rem .9rem |
|
||||
| ul.nav a | border-radius | 999px |
|
||||
| ul.nav a | color | var(--ink-soft) |
|
||||
| ul.nav a | font-weight | 500 |
|
||||
| ul.nav a | text-decoration | none |
|
||||
| ul.nav a | transition | background .18s ease, color .18s ease |
|
||||
| ul.nav a:hover | background | rgba(79,70,229,.1) |
|
||||
| ul.nav a:hover | color | var(--accent) |
|
||||
| ul.nav li:first-child a | font-family | var(--serif) |
|
||||
| ul.nav li:first-child a | font-size | 1.25rem |
|
||||
| ul.nav li:first-child a | font-weight | 700 |
|
||||
| ul.nav li:first-child a | background | linear-gradient(120deg, var(--accent), var(--accent-2)) |
|
||||
| ul.nav li:first-child a | -webkit-background-clip | text |
|
||||
| ul.nav li:first-child a | background-clip | text |
|
||||
| ul.nav li:first-child a | -webkit-text-fill-color | transparent |
|
||||
| ul.nav li:first-child a | color | transparent |
|
||||
| ul.nav li:first-child a | padding-left | .2rem |
|
||||
| ul.nav li:first-child a | padding-right | .2rem |
|
||||
|
||||
## 侧栏
|
||||
|
||||
侧栏段保留归档面板的布局、链接间距和悬停反馈。它只提供样式数据,具体侧栏内容仍由独立组件或 Document 负责。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| aside.side | grid-area | side |
|
||||
| aside.side | padding | 2rem 1.25rem |
|
||||
| aside.side | border-right | 1px solid var(--line) |
|
||||
| aside.side | background | linear-gradient(180deg, #fbfaf8, #f3f1ec) |
|
||||
| ul.side-nav | list-style | none |
|
||||
| ul.side-nav | margin | 0 |
|
||||
| ul.side-nav | padding | 0 |
|
||||
| ul.side-nav | display | flex |
|
||||
| ul.side-nav | flex-direction | column |
|
||||
| ul.side-nav | gap | .25rem |
|
||||
| ul.side-nav li | margin | 0 |
|
||||
| ul.side-nav a | display | block |
|
||||
| ul.side-nav a | padding | .55rem .85rem |
|
||||
| ul.side-nav a | border-radius | 10px |
|
||||
| ul.side-nav a | color | var(--ink-soft) |
|
||||
| ul.side-nav a | text-decoration | none |
|
||||
| ul.side-nav a | font-weight | 500 |
|
||||
| ul.side-nav a | transition | background .15s ease, transform .15s ease, color .15s ease |
|
||||
| ul.side-nav a:hover | background | #fff |
|
||||
| ul.side-nav a:hover | color | var(--accent) |
|
||||
| ul.side-nav a:hover | transform | translateX(4px) |
|
||||
| ul.side-nav a:hover | box-shadow | 0 1px 3px rgba(28,25,23,.08) |
|
||||
|
||||
## 主体
|
||||
|
||||
主体段定义内容区留白、标题和导语的排版节奏。数据读取保持原有字段和值;主题编译不会替页面构造布局节点。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| main.main | grid-area | main |
|
||||
| main.main | padding | 2.5rem 2.5rem 3.5rem |
|
||||
| main.main | max-width | 76rem |
|
||||
| main.main | width | 100% |
|
||||
| .main-intro | margin-bottom | .5rem |
|
||||
| .main-intro h1 | font-family | var(--serif) |
|
||||
| .main-intro h1 | margin | 0 0 .5rem |
|
||||
| .main-intro h1 | font-size | clamp(2rem, 5vw, 2.9rem) |
|
||||
| .main-intro h1 | line-height | 1.2 |
|
||||
| .main-intro h1 | font-weight | 700 |
|
||||
| .main-intro h1 | letter-spacing | -.01em |
|
||||
| .main-intro p | color | var(--muted) |
|
||||
| .main-intro p | margin | 0 |
|
||||
| .main-intro p | font-size | 1.05rem |
|
||||
|
||||
## 卡片
|
||||
|
||||
卡片段保留文章列表的网格、阴影、封面和悬停状态。样式类名应与页面输出保持一致;此函数只读取声明,不查询文章数据。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| .content.cards | display | grid |
|
||||
| .content.cards | gap | 1.5rem |
|
||||
| .content.cards | margin-top | 2rem |
|
||||
| .content.cards | grid-template-columns | repeat(auto-fill, minmax(17rem, 1fr)) |
|
||||
| .content.cards article.card | background | var(--card) |
|
||||
| .content.cards article.card | border | 1px solid var(--line) |
|
||||
| .content.cards article.card | border-radius | var(--radius) |
|
||||
| .content.cards article.card | padding | 1.6rem 1.7rem |
|
||||
| .content.cards article.card | box-shadow | var(--shadow) |
|
||||
| .content.cards article.card | transition | transform .22s ease, box-shadow .22s ease, border-color .22s ease |
|
||||
| .content.cards article.card | display | flex |
|
||||
| .content.cards article.card | flex-direction | column |
|
||||
| .content.cards article.card | gap | .55rem |
|
||||
| .content.cards article.card:hover | transform | translateY(-6px) |
|
||||
| .content.cards article.card:hover | box-shadow | var(--shadow-lg) |
|
||||
| .content.cards article.card:hover | border-color | rgba(79,70,229,.35) |
|
||||
| .content.cards a.card-link | text-decoration | none |
|
||||
| .content.cards a.card-link | color | inherit |
|
||||
| .content.cards a.card-link | display | flex |
|
||||
| .content.cards a.card-link | flex-direction | column |
|
||||
| .content.cards a.card-link | gap | .55rem |
|
||||
| .content.cards a.card-link | height | 100% |
|
||||
| .content.cards a.card-link:hover | color | inherit |
|
||||
| .content.cards h2 | font-family | var(--serif) |
|
||||
| .content.cards h2 | margin | 0 |
|
||||
| .content.cards h2 | font-size | 1.35rem |
|
||||
| .content.cards h2 | line-height | 1.35 |
|
||||
| .content.cards h2 | font-weight | 700 |
|
||||
| .content.cards h2 | transition | color .18s ease |
|
||||
| .content.cards a.card-link:hover h2 | color | var(--accent) |
|
||||
| .card-meta | font-size | .82rem |
|
||||
| .card-meta | color | var(--faint) |
|
||||
| .card-meta | letter-spacing | .04em |
|
||||
| .card-meta | text-transform | uppercase |
|
||||
| .card-tag | align-self | flex-start |
|
||||
| .card-tag | font-size | .78rem |
|
||||
| .card-tag | color | var(--accent) |
|
||||
| .card-tag | background | rgba(79,70,229,.08) |
|
||||
| .card-tag | padding | .15rem .65rem |
|
||||
| .card-tag | border-radius | 999px |
|
||||
| .card-tag | font-weight | 600 |
|
||||
| .content.cards p | color | var(--muted) |
|
||||
| .content.cards p | margin | 0 |
|
||||
| .content.cards p | font-size | .95rem |
|
||||
| .content.cards p | flex | 1 |
|
||||
|
||||
## 页脚
|
||||
|
||||
页脚段保留页面末尾的留白、分隔线和链接外观。页脚若分为多个布局区域,仍应沿组件目录拆分,样式声明不会代替工程结构。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| footer.foot | grid-area | foot |
|
||||
| footer.foot | padding | 1.4rem 2rem |
|
||||
| footer.foot | border-top | 1px solid var(--line) |
|
||||
| footer.foot | color | var(--muted) |
|
||||
| footer.foot | background | #fff |
|
||||
| footer.foot | font-size | .9rem |
|
||||
| footer.foot | display | flex |
|
||||
| footer.foot | justify-content | space-between |
|
||||
| footer.foot | align-items | center |
|
||||
| footer.foot | flex-wrap | wrap |
|
||||
| footer.foot | gap | .5rem |
|
||||
| ul.foot-nav | list-style | none |
|
||||
| ul.foot-nav | margin | 0 |
|
||||
| ul.foot-nav | padding | 0 |
|
||||
| ul.foot-nav | display | flex |
|
||||
| ul.foot-nav | gap | 1rem |
|
||||
| ul.foot-nav | flex-wrap | wrap |
|
||||
| ul.foot-nav li | margin | 0 |
|
||||
| ul.foot-nav a | color | var(--muted) |
|
||||
| ul.foot-nav a | text-decoration | none |
|
||||
| ul.foot-nav a:hover | color | var(--accent) |
|
||||
|
||||
## 表单
|
||||
|
||||
表单段保留输入控件、按钮和管理操作的状态样式。字段校验、保存和鉴权属于数据与安全资源;样式只改变已存在控件的外观。
|
||||
|
||||
| 选择器 | 属性 | 值 |
|
||||
|--------|------|-----|
|
||||
| .site-form | margin-top | 1.75rem |
|
||||
| .site-form | max-width | 34rem |
|
||||
| .site-form | background | var(--card) |
|
||||
| .site-form | border | 1px solid var(--line) |
|
||||
| .site-form | border-radius | var(--radius) |
|
||||
| .site-form | padding | 1.8rem |
|
||||
| .site-form | box-shadow | var(--shadow) |
|
||||
| .site-form form | display | grid |
|
||||
| .site-form form | gap | 1rem |
|
||||
| .site-form label | display | grid |
|
||||
| .site-form label | gap | .35rem |
|
||||
| .site-form label | font-size | .92rem |
|
||||
| .site-form label | font-weight | 600 |
|
||||
| .site-form label | color | var(--ink-soft) |
|
||||
| .site-form input | padding | .65rem .8rem |
|
||||
| .site-form input | border | 1px solid var(--line) |
|
||||
| .site-form input | border-radius | 10px |
|
||||
| .site-form input | font | inherit |
|
||||
| .site-form input | background | #fdfcfb |
|
||||
| .site-form input | transition | border-color .15s ease, box-shadow .15s ease |
|
||||
| .site-form textarea | padding | .65rem .8rem |
|
||||
| .site-form textarea | border | 1px solid var(--line) |
|
||||
| .site-form textarea | border-radius | 10px |
|
||||
| .site-form textarea | font | inherit |
|
||||
| .site-form textarea | background | #fdfcfb |
|
||||
| .site-form textarea | transition | border-color .15s ease, box-shadow .15s ease |
|
||||
| .site-form select | padding | .65rem .8rem |
|
||||
| .site-form select | border | 1px solid var(--line) |
|
||||
| .site-form select | border-radius | 10px |
|
||||
| .site-form select | font | inherit |
|
||||
| .site-form select | background | #fdfcfb |
|
||||
| .site-form select | transition | border-color .15s ease, box-shadow .15s ease |
|
||||
| .site-form input:focus | outline | none |
|
||||
| .site-form input:focus | border-color | var(--accent) |
|
||||
| .site-form input:focus | box-shadow | 0 0 0 3px rgba(79,70,229,.12) |
|
||||
| .site-form textarea:focus | outline | none |
|
||||
| .site-form textarea:focus | border-color | var(--accent) |
|
||||
| .site-form textarea:focus | box-shadow | 0 0 0 3px rgba(79,70,229,.12) |
|
||||
| .site-form select:focus | outline | none |
|
||||
| .site-form select:focus | border-color | var(--accent) |
|
||||
| .site-form select:focus | box-shadow | 0 0 0 3px rgba(79,70,229,.12) |
|
||||
| .site-form input[readonly] | background | #f5f5f4 |
|
||||
| .site-form input[readonly] | color | var(--muted) |
|
||||
| .site-form textarea | min-height | 10rem |
|
||||
| .site-form textarea | resize | vertical |
|
||||
| .site-form .err | color | #b91c1c |
|
||||
| .site-form .err | font-size | .85rem |
|
||||
| .site-form .actions | display | flex |
|
||||
| .site-form .actions | gap | .75rem |
|
||||
| .site-form .actions | align-items | center |
|
||||
| .site-form .actions | flex-wrap | wrap |
|
||||
| .site-form .actions | padding-top | .25rem |
|
||||
| .site-form button | background | linear-gradient(120deg, var(--accent), var(--accent-2)) |
|
||||
| .site-form button | color | var(--accent-ink) |
|
||||
| .site-form button | border | 0 |
|
||||
| .site-form button | padding | .6rem 1.3rem |
|
||||
| .site-form button | border-radius | 999px |
|
||||
| .site-form button | cursor | pointer |
|
||||
| .site-form button | font-weight | 600 |
|
||||
| .site-form button | font-size | .95rem |
|
||||
| .site-form button | transition | opacity .15s ease, transform .15s ease, box-shadow .15s ease |
|
||||
| .site-form button:hover | opacity | .92 |
|
||||
| .site-form button:hover | transform | translateY(-1px) |
|
||||
| .site-form button:hover | box-shadow | 0 6px 18px rgba(79,70,229,.3) |
|
||||
| .site-form a.btn | display | inline-block |
|
||||
| .site-form a.btn | padding | .6rem 1.3rem |
|
||||
| .site-form a.btn | border-radius | 999px |
|
||||
| .site-form a.btn | border | 1px solid var(--line) |
|
||||
| .site-form a.btn | color | var(--ink-soft) |
|
||||
| .site-form a.btn | text-decoration | none |
|
||||
| .site-form a.btn | font-weight | 500 |
|
||||
| .site-form a.btn | font-size | .95rem |
|
||||
| .site-form .meta | color | var(--muted) |
|
||||
| .site-form .meta | font-size | .9rem |
|
||||
| .site-form .admin-list | margin | 0 |
|
||||
| .site-form .admin-list | padding | 0 |
|
||||
| .site-form .admin-list | list-style | none |
|
||||
| .site-form .admin-list | display | grid |
|
||||
| .site-form .admin-list | gap | .5rem |
|
||||
| .site-form .admin-list li | background | #fdfcfb |
|
||||
| .site-form .admin-list li | border | 1px solid var(--line) |
|
||||
| .site-form .admin-list li | border-radius | 10px |
|
||||
| .site-form .admin-list li | padding | .6rem .9rem |
|
||||
| .site-form .admin-list li | display | flex |
|
||||
| .site-form .admin-list li | justify-content | space-between |
|
||||
| .site-form .admin-list li | align-items | center |
|
||||
| .site-form .admin-list li | gap | 1rem |
|
||||
| .site-form .admin-list a | color | var(--accent) |
|
||||
| .site-form .admin-list a | text-decoration | none |
|
||||
| .site-form .admin-list a | font-size | .9rem |
|
||||
|
||||
## 响应式
|
||||
|
||||
响应式段保留窄屏断点、侧栏流向、内容间距和列表列数。媒体条件仍由原生样式编译器读取,浏览器结果需要实际窄屏验证。
|
||||
|
||||
| 媒体 | 选择器 | 属性 | 值 |
|
||||
|------|--------|------|-----|
|
||||
| (max-width: 860px) | body.has-sidebar | grid-template-columns | 1fr |
|
||||
| (max-width: 860px) | body.has-sidebar | grid-template-areas | "top" "main" "side" "foot" |
|
||||
| (max-width: 860px) | aside.side | border-right | 0 |
|
||||
| (max-width: 860px) | aside.side | border-bottom | 1px solid var(--line) |
|
||||
| (max-width: 860px) | aside.side | padding | 1rem 2rem |
|
||||
| (max-width: 860px) | ul.side-nav | flex-direction | row |
|
||||
| (max-width: 860px) | ul.side-nav | flex-wrap | wrap |
|
||||
| (max-width: 860px) | main.main | padding | 1.75rem 1.25rem 2.5rem |
|
||||
| (max-width: 860px) | header.topnav | padding | .75rem 1.25rem |
|
||||
| (max-width: 860px) | footer.foot | padding | 1.2rem 1.25rem |
|
||||
| (max-width: 860px) | .content.cards | grid-template-columns | 1fr |
|
||||
| (max-width: 520px) | ul.nav | flex-wrap | wrap |
|
||||
Reference in new issue
Block a user