From d941875c17fa9a61c29c664955280e7d2da9908d Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 3 May 2024 12:29:47 +0800 Subject: [PATCH] document --- .../administration/customizing-gitea.en-us.md | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/content/administration/customizing-gitea.en-us.md b/docs/content/administration/customizing-gitea.en-us.md index 8475f6d131..f25f124242 100644 --- a/docs/content/administration/customizing-gitea.en-us.md +++ b/docs/content/administration/customizing-gitea.en-us.md @@ -383,13 +383,27 @@ To make a custom theme available to all users: The value of `$GITEA_CUSTOM` of your instance can be queried by calling `gitea help` and looking up the value of "CustomPath". 2. Add `` to the comma-separated list of setting `THEMES` in `app.ini`, or leave `THEMES` empty to allow all themes. +A custom theme file named `theme-my-theme.css` will be displayed as `my-theme` on the user's theme selection page. +It could add theme meta information into the custom theme CSS file to provide more information about the theme. + +If a custom theme is a dark theme, please set the global css variable `--is-dark-theme: true` in the `:root` block. +This allows Gitea to adjust the Monaco code editor's theme accordingly. + +```css +gitea-theme-meta-info { + --theme-display-name: "My Awesome Theme"; /* this theme will be display as "My Awesome Theme" on the UI */ +} +:root { + --is-dark-theme: true; /* if it is a dark theme */ + --color-primary: #112233; + /* more custom theme variables ... */ +} +``` + Community themes are listed in [gitea/awesome-gitea#themes](https://gitea.com/gitea/awesome-gitea#themes). The default theme sources can be found [here](https://github.com/go-gitea/gitea/blob/main/web_src/css/themes). -If your custom theme is considered a dark theme, set the global css variable `--is-dark-theme` to `true`. -This allows Gitea to adjust the Monaco code editor's theme accordingly. - ## Customizing fonts Fonts can be customized using CSS variables: