主题定制指南:模板、组件与配色

2026-10-18 约 1 分钟读完 640 次浏览 1 条评论

主题目录

themes/default/
├── layout.phtml
├── templates/
│   ├── home.phtml
│   ├── posts.phtml
│   └── partials/post_card.phtml
└── theme.json

复用局部模板

<?= $this->partial('partials/post_card', ['post' => $post]) ?>

配色

颜色集中在 CSS 变量里,改三个值就能换风格:

:root {
  --nx-primary: #10b981;
  --nx-radius: 12px;
  --nx-surface: #ffffff;
}

主题目录位于 themes/,升级时不会被覆盖。

相关文章

评论(1)

  • Yuki · 10-28
    换配色的三个变量太好用了。

发表评论