跳到主内容

自定义主题

This guide explains how to match the Casdoor pages to your brand by setting the style, the primary color, the border radius, and the compact mode.


学习成果​

  • 了解主题的三个层级。
  • 设置组织的主题。
  • 设置单个应用程序的主题。

所需条件​

  • 拥有 Casdoor 管理控制台的管理员访问权限

主题层级​

层级Where you set itWhere it applies
全局In the source code only, in web/src/Conf.tsEvery organization that has no theme of its own
选择组织Edit page of the organizationAll pages of the admin console for members of the organization, and the entry pages (sign-in, sign-up, forgot password, and so on) of the applications that follow the organization theme
可以访问的应用Edit page of the applicationThe entry pages of that application only

主题设置​

SettingDescription
Theme页面样式。Default 遵循访客选择的浅色或深色模式。Dark 始终显示深色模式并将边框半径设置为 2。Document 将主色设置为绿色并将边框半径设置为 4。Blossom 将主色设置为粉色并将边框半径设置为 16。选择样式后,您可以更改主色和边框半径
Primary color按钮、链接和其他高亮元素的颜色。可选择预设颜色或输入任意颜色
Border radius圆角的圆润程度,单位为像素
Is compact以较小的文本和更紧凑的间距显示页面

设置组织的主题​

  1. 在 Casdoor 管理控制台中,打开组织的编辑页面。
  2. 在 Advanced 选项卡中,于 Customize theme 下关闭 Follow global theme,并设置主题设置。
  3. 保存组织。

Recording of editing the theme of an organization

如果您编辑的是当前登录的组织,更改将立即生效。否则,请登录到该组织以查看主题。

设置应用程序的主题​

  1. 打开应用的编辑页面。

  2. 关闭 Follow organization theme,并在主题编辑器中设置主题设置。

  3. 在应用的预览面板中检查结果。

    Theme preview on the application edit page

  4. 保存应用。

另请参阅​