Skip to content

Commit 6972daa

Browse files
committed
Rename the default themes to gitea-light and gitea-dark
1 parent e94f9fc commit 6972daa

File tree

12 files changed

+286
-245
lines changed

12 files changed

+286
-245
lines changed

custom/conf/app.example.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ LEVEL = Info
12121212
;DEFAULT_THEME = auto
12131213
;;
12141214
;; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`.
1215-
;THEMES = auto,gitea,arc-green
1215+
;THEMES = auto,gitea-light,gitea-dark
12161216
;;
12171217
;; All available reactions users can choose on issues/prs and comments.
12181218
;; Values can be emoji alias (:smile:) or a unicode emoji.

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ The following configuration set `Content-Type: application/vnd.android.package-a
215215
- `SITEMAP_PAGING_NUM`: **20**: Number of items that are displayed in a single subsitemap.
216216
- `GRAPH_MAX_COMMIT_NUM`: **100**: Number of maximum commits shown in the commit graph.
217217
- `CODE_COMMENT_LINES`: **4**: Number of line of codes shown for a code comment.
218-
- `DEFAULT_THEME`: **auto**: \[auto, gitea, arc-green\]: Set the default theme for the Gitea install.
218+
- `DEFAULT_THEME`: **auto**: \[auto, gitea-light, gitea-dark\]: Set the default theme for the Gitea install.
219219
- `SHOW_USER_EMAIL`: **true**: Whether the email of the user should be shown in the Explore Users page.
220-
- `THEMES`: **auto,gitea,arc-green**: All available themes. Allow users select personalized themes.
220+
- `THEMES`: **auto,gitea-light,gitea-dark**: All available themes. Allow users select personalized themes.
221221
regardless of the value of `DEFAULT_THEME`.
222222
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
223223
- `REACTIONS`: All available reactions users can choose on issues/prs and comments

docs/content/administration/config-cheat-sheet.zh-cn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ menu:
214214
- `SITEMAP_PAGING_NUM`: **20**: 在单个子SiteMap中显示的项数。
215215
- `GRAPH_MAX_COMMIT_NUM`: **100**: 提交图中显示的最大commit数量。
216216
- `CODE_COMMENT_LINES`: **4**: 在代码评论中能够显示的最大代码行数。
217-
- `DEFAULT_THEME`: **auto**: \[auto, gitea, arc-green\]: 在Gitea安装时候设置的默认主题。
217+
- `DEFAULT_THEME`: **auto**: \[auto, gitea-light, gitea-dark\]: 在Gitea安装时候设置的默认主题。
218218
- `SHOW_USER_EMAIL`: **true**: 用户的电子邮件是否应该显示在`Explore Users`页面中。
219-
- `THEMES`: **auto,gitea,arc-green**: 所有可用的主题。允许用户选择个性化的主题,
219+
- `THEMES`: **auto,gitea-light,gitea-dark**: 所有可用的主题。允许用户选择个性化的主题,
220220
而不受DEFAULT_THEME 值的影响。
221221
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: 能够显示文件的最大大小(默认为8MiB)。
222222
- `REACTIONS`: 用户可以在问题(Issue)、Pull Request(PR)以及评论中选择的所有可选的反应。

docs/content/help/faq.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Use [Fail2Ban](administration/fail2ban-setup.md) to monitor and stop automated l
181181

182182
## How to add/use custom themes
183183

184-
Gitea supports three official themes right now, `gitea` (light), `arc-green` (dark), and `auto` (automatically switches between the previous two depending on operating system settings).
184+
Gitea supports three official themes right now, `gitea-light`, `gitea-dark`, and `auto` (automatically switches between the previous two depending on operating system settings).
185185
To add your own theme, currently the only way is to provide a complete theme (not just color overrides)
186186

187187
As an example, let's say our theme is `arc-blue` (this is a real theme, and can be found [in this issue](https://github.com/go-gitea/gitea/issues/6011))

docs/content/help/faq.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Gitea不提供内置的Pages服务器。您需要一个专用的域名来提供
185185

186186
## 如何添加/使用自定义主题
187187

188-
Gitea 目前支持三个官方主题,分别是 `gitea`(亮色)、`arc-green`(暗色)`auto`(根据操作系统设置自动切换前两个主题)。
188+
Gitea 目前支持三个官方主题,分别是 `gitea-light``gitea-dark` `auto`(根据操作系统设置自动切换前两个主题)。
189189
要添加自己的主题,目前唯一的方法是提供一个完整的主题(不仅仅是颜色覆盖)。
190190

191191
假设我们的主题是 `arc-blue`(这是一个真实的主题,可以在[此问题](https://github.com/go-gitea/gitea/issues/6011)中找到)

models/migrations/migrations.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"code.gitea.io/gitea/models/migrations/v1_19"
2121
"code.gitea.io/gitea/models/migrations/v1_20"
2222
"code.gitea.io/gitea/models/migrations/v1_21"
23+
"code.gitea.io/gitea/models/migrations/v1_22"
2324
"code.gitea.io/gitea/models/migrations/v1_6"
2425
"code.gitea.io/gitea/models/migrations/v1_7"
2526
"code.gitea.io/gitea/models/migrations/v1_8"
@@ -538,6 +539,12 @@ var migrations = []Migration{
538539
NewMigration("Add Index to issue_user.issue_id", v1_21.AddIndexToIssueUserIssueID),
539540
// v278 -> v279
540541
NewMigration("Add Index to comment.dependent_issue_id", v1_21.AddIndexToCommentDependentIssueID),
542+
543+
// Gitea 1.21.0 ends at 279
544+
545+
// v279 -> v280
546+
NewMigration("Rename user themes", v1_22.RenameUserThemes),
547+
541548
}
542549

543550
// GetCurrentDBVersion returns the current db version

models/migrations/v1_22/v279.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2023 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package v1_22 //nolint
5+
6+
import (
7+
"xorm.io/xorm"
8+
)
9+
10+
func RenameUserThemes(x *xorm.Engine) error {
11+
sess := x.NewSession()
12+
defer sess.Close()
13+
14+
if err := sess.Begin(); err != nil {
15+
return err
16+
}
17+
18+
if _, err := sess.Exec(`UPDATE user SET theme = 'gitea-light' WHERE theme = 'gitea'`); err != nil {
19+
return err
20+
}
21+
if _, err := sess.Exec(`UPDATE user SET theme = 'gitea-dark' WHERE theme = 'arc-green'`); err != nil {
22+
return err
23+
}
24+
25+
return sess.Commit()
26+
}

modules/setting/ui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ var UI = struct {
7777
ReactionMaxUserNum: 10,
7878
MaxDisplayFileSize: 8388608,
7979
DefaultTheme: `auto`,
80-
Themes: []string{`auto`, `gitea`, `arc-green`},
80+
Themes: []string{`auto`, `gitea-light`, `gitea-dark`},
8181
Reactions: []string{`+1`, `-1`, `laugh`, `hooray`, `confused`, `heart`, `rocket`, `eyes`},
8282
CustomEmojis: []string{`git`, `gitea`, `codeberg`, `gitlab`, `github`, `gogs`},
8383
CustomEmojisMap: map[string]string{"git": ":git:", "gitea": ":gitea:", "codeberg": ":codeberg:", "gitlab": ":gitlab:", "github": ":github:", "gogs": ":gogs:"},

web_src/css/base.css

Lines changed: 0 additions & 235 deletions
Original file line numberDiff line numberDiff line change
@@ -22,241 +22,6 @@
2222
--opacity-disabled: 0.55;
2323
--height-loading: 16rem;
2424
--tab-size: 4;
25-
/* base colors */
26-
--color-primary: #4183c4;
27-
--color-primary-contrast: #ffffff;
28-
--color-primary-dark-1: #3876b3;
29-
--color-primary-dark-2: #31699f;
30-
--color-primary-dark-3: #2b5c8b;
31-
--color-primary-dark-4: #254f77;
32-
--color-primary-dark-5: #193450;
33-
--color-primary-dark-6: #0c1a28;
34-
--color-primary-dark-7: #04080c;
35-
--color-primary-light-1: #548fca;
36-
--color-primary-light-2: #679cd0;
37-
--color-primary-light-3: #7aa8d6;
38-
--color-primary-light-4: #8db5dc;
39-
--color-primary-light-5: #b3cde7;
40-
--color-primary-light-6: #d9e6f3;
41-
--color-primary-light-7: #f4f8fb;
42-
--color-primary-alpha-10: #4183c419;
43-
--color-primary-alpha-20: #4183c433;
44-
--color-primary-alpha-30: #4183c44b;
45-
--color-primary-alpha-40: #4183c466;
46-
--color-primary-alpha-50: #4183c480;
47-
--color-primary-alpha-60: #4183c499;
48-
--color-primary-alpha-70: #4183c4b3;
49-
--color-primary-alpha-80: #4183c4cc;
50-
--color-primary-alpha-90: #4183c4e1;
51-
--color-primary-hover: var(--color-primary-dark-1);
52-
--color-primary-active: var(--color-primary-dark-2);
53-
--color-secondary: #dedede;
54-
--color-secondary-dark-1: #cecece;
55-
--color-secondary-dark-2: #bfbfbf;
56-
--color-secondary-dark-3: #a0a0a0;
57-
--color-secondary-dark-4: #909090;
58-
--color-secondary-dark-5: #818181;
59-
--color-secondary-dark-6: #717171;
60-
--color-secondary-dark-7: #626262;
61-
--color-secondary-dark-8: #525252;
62-
--color-secondary-dark-9: #434343;
63-
--color-secondary-dark-10: #333333;
64-
--color-secondary-dark-11: #242424;
65-
--color-secondary-dark-12: #141414;
66-
--color-secondary-dark-13: #040404;
67-
--color-secondary-light-1: #e5e5e5;
68-
--color-secondary-light-2: #ebebeb;
69-
--color-secondary-light-3: #f2f2f2;
70-
--color-secondary-light-4: #f8f8f8;
71-
--color-secondary-alpha-10: #dedede19;
72-
--color-secondary-alpha-20: #dedede33;
73-
--color-secondary-alpha-30: #dedede4b;
74-
--color-secondary-alpha-40: #dedede66;
75-
--color-secondary-alpha-50: #dedede80;
76-
--color-secondary-alpha-60: #dedede99;
77-
--color-secondary-alpha-70: #dededeb3;
78-
--color-secondary-alpha-80: #dededecc;
79-
--color-secondary-alpha-90: #dededee1;
80-
--color-secondary-button: var(--color-secondary-dark-4);
81-
--color-secondary-hover: var(--color-secondary-dark-5);
82-
--color-secondary-active: var(--color-secondary-dark-6);
83-
/* console colors - used for actions console and console files */
84-
--color-console-fg: #eeeff2;
85-
--color-console-fg-subtle: #959cab;
86-
--color-console-bg: #262936;
87-
--color-console-border: #383c47;
88-
--color-console-hover-bg: #ffffff16;
89-
--color-console-active-bg: #454a57;
90-
--color-console-menu-bg: #383c47;
91-
--color-console-menu-border: #5c6374;
92-
/* named colors */
93-
--color-red: #db2828;
94-
--color-orange: #f2711c;
95-
--color-yellow: #fbbd08;
96-
--color-olive: #b5cc18;
97-
--color-green: #21ba45;
98-
--color-teal: #00b5ad;
99-
--color-blue: #2185d0;
100-
--color-violet: #6435c9;
101-
--color-purple: #a333c8;
102-
--color-pink: #e03997;
103-
--color-brown: #a5673f;
104-
--color-black: #1b1c1d;
105-
/* light variants - produced via Sass scale-color(color, $lightness: +25%) */
106-
--color-red-light: #e45e5e;
107-
--color-orange-light: #f59555;
108-
--color-yellow-light: #fcce46;
109-
--color-olive-light: #d3e942;
110-
--color-green-light: #46de6a;
111-
--color-teal-light: #08fff4;
112-
--color-blue-light: #51a5e3;
113-
--color-violet-light: #8b67d7;
114-
--color-purple-light: #bb64d8;
115-
--color-pink-light: #e86bb1;
116-
--color-brown-light: #c58b66;
117-
--color-black-light: #525558;
118-
/* dark 1 variants - produced via Sass scale-color(color, $lightness: -10%) */
119-
--color-red-dark-1: #c82121;
120-
--color-orange-dark-1: #e6630d;
121-
--color-yellow-dark-1: #e5ac04;
122-
--color-olive-dark-1: #a3b816;
123-
--color-green-dark-1: #1ea73e;
124-
--color-teal-dark-1: #00a39c;
125-
--color-blue-dark-1: #1e78bb;
126-
--color-violet-dark-1: #5a30b5;
127-
--color-purple-dark-1: #932eb4;
128-
--color-pink-dark-1: #db228a;
129-
--color-brown-dark-1: #955d39;
130-
--color-black-dark-1: #18191a;
131-
/* dark 2 variants - produced via Sass scale-color(color, $lightness: -20%) */
132-
--color-red-dark-2: #b11e1e;
133-
--color-orange-dark-2: #cc580c;
134-
--color-yellow-dark-2: #cc9903;
135-
--color-olive-dark-2: #91a313;
136-
--color-green-dark-2: #1a9537;
137-
--color-teal-dark-2: #00918a;
138-
--color-blue-dark-2: #1a6aa6;
139-
--color-violet-dark-2: #502aa1;
140-
--color-purple-dark-2: #8229a0;
141-
--color-pink-dark-2: #c21e7b;
142-
--color-brown-dark-2: #845232;
143-
--color-black-dark-2: #161617;
144-
/* ansi colors used for actions console and console files */
145-
--color-ansi-black: var(--color-black);
146-
--color-ansi-red: var(--color-red);
147-
--color-ansi-green: var(--color-green);
148-
--color-ansi-yellow: var(--color-yellow);
149-
--color-ansi-blue: var(--color-blue);
150-
--color-ansi-magenta: var(--color-pink);
151-
--color-ansi-cyan: var(--color-teal);
152-
--color-ansi-white: var(--color-console-fg-subtle);
153-
--color-ansi-bright-black: var(--color-black-light);
154-
--color-ansi-bright-red: var(--color-red-light);
155-
--color-ansi-bright-green: var(--color-green-light);
156-
--color-ansi-bright-yellow: var(--color-yellow-light);
157-
--color-ansi-bright-blue: var(--color-blue-light);
158-
--color-ansi-bright-magenta: var(--color-pink-light);
159-
--color-ansi-bright-cyan: var(--color-teal-light);
160-
--color-ansi-bright-white: var(--color-console-fg);
161-
/* other colors */
162-
--color-grey: #707070;
163-
--color-grey-light: #838383;
164-
--color-gold: #a1882b;
165-
--color-white: #ffffff;
166-
--color-diff-removed-word-bg: #fdb8c0;
167-
--color-diff-added-word-bg: #acf2bd;
168-
--color-diff-removed-row-bg: #ffeef0;
169-
--color-diff-moved-row-bg: #f1f8d1;
170-
--color-diff-added-row-bg: #e6ffed;
171-
--color-diff-removed-row-border: #f1c0c0;
172-
--color-diff-moved-row-border: #d0e27f;
173-
--color-diff-added-row-border: #e6ffed;
174-
--color-diff-inactive: #f2f2f2;
175-
--color-error-border: #e0b4b4;
176-
--color-error-bg: #fff6f6;
177-
--color-error-bg-active: #fbb;
178-
--color-error-bg-hover: #fdd;
179-
--color-error-text: #9f3a38;
180-
--color-success-border: #a3c293;
181-
--color-success-bg: #fcfff5;
182-
--color-success-text: #2c662d;
183-
--color-warning-border: #c9ba9b;
184-
--color-warning-bg: #fffaf3;
185-
--color-warning-text: #573a08;
186-
--color-info-border: #a9d5de;
187-
--color-info-bg: #f8ffff;
188-
--color-info-text: #276f86;
189-
--color-red-badge: #db2828;
190-
--color-red-badge-bg: #db28281a;
191-
--color-red-badge-hover-bg: #db28284d;
192-
--color-green-badge: #21ba45;
193-
--color-green-badge-bg: #21ba451a;
194-
--color-green-badge-hover-bg: #21ba454d;
195-
--color-yellow-badge: #fbbd08;
196-
--color-yellow-badge-bg: #fbbd081a;
197-
--color-yellow-badge-hover-bg: #fbbd084d;
198-
--color-orange-badge: #f2711c;
199-
--color-orange-badge-bg: #f2711c1a;
200-
--color-orange-badge-hover-bg: #f2711c4d;
201-
--color-git: #f05133;
202-
/* target-based colors */
203-
--color-body: #ffffff;
204-
--color-text-dark: #080808;
205-
--color-text: #212121;
206-
--color-text-light: #555555;
207-
--color-text-light-1: #6a6a6a;
208-
--color-text-light-2: #808080;
209-
--color-text-light-3: #a0a0a0;
210-
--color-box-header: #f7f7f7;
211-
--color-box-body: #ffffff;
212-
--color-box-body-highlight: #fafafa;
213-
--color-footer: #ffffff;
214-
--color-timeline: #ececec;
215-
--color-input-text: #212121;
216-
--color-input-background: #fafafa;
217-
--color-input-toggle-background: #dedede;
218-
--color-input-border: var(--color-secondary);
219-
--color-input-border-hover: var(--color-secondary-dark-1);
220-
--color-header-wrapper: transparent;
221-
--color-light: #00000006;
222-
--color-light-mimic-enabled: rgba(0, 0, 0, calc(6 / 255 * 222 / 255 / var(--opacity-disabled)));
223-
--color-light-border: #0000001d;
224-
--color-hover: #00000014;
225-
--color-active: #0000001b;
226-
--color-menu: #fafafa;
227-
--color-card: #fafafa;
228-
--color-markup-table-row: #00000008;
229-
--color-markup-code-block: #00000010;
230-
--color-button: #fafafa;
231-
--color-code-bg: #ffffff;
232-
--color-code-sidebar-bg: #f5f5f5;
233-
--color-shadow: #00000026;
234-
--color-secondary-bg: #f4f4f4;
235-
--color-expand-button: #d8efff;
236-
--color-placeholder-text: #aaa;
237-
--color-editor-line-highlight: var(--color-primary-light-6);
238-
--color-project-board-bg: var(--color-secondary-light-4);
239-
--color-project-board-dark-label: #111111;
240-
--color-project-board-light-label: #eeeeee;
241-
--color-caret: var(--color-text-dark);
242-
--color-reaction-bg: #0000000a;
243-
--color-reaction-hover-bg: var(--color-primary-light-5);
244-
--color-reaction-active-bg: var(--color-primary-light-6);
245-
--color-tooltip-text: #ffffff;
246-
--color-tooltip-bg: #000000f0;
247-
--color-nav-bg: #ffffff;
248-
--color-nav-hover-bg: #ebebeb;
249-
--color-nav-text: var(--color-text);
250-
--color-label-text: #232323;
251-
--color-label-bg: #cacaca5b;
252-
--color-label-hover-bg: #cacacaa0;
253-
--color-label-active-bg: #cacacaff;
254-
--color-accent: var(--color-primary-light-1);
255-
--color-small-accent: var(--color-primary-light-6);
256-
--color-active-line: #fffbdd;
257-
--color-overlay-backdrop: #080808c0;
258-
accent-color: var(--color-accent);
259-
color-scheme: light;
26025
}
26126

26227
:root * {

web_src/css/themes/theme-auto.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
@import "./theme-arc-green.css" (prefers-color-scheme: dark);
1+
@import "./theme-gitea-light.css" (prefers-color-scheme: light);
2+
@import "./theme-gitea-dark.css" (prefers-color-scheme: dark);

web_src/css/themes/theme-arc-green.css renamed to web_src/css/themes/theme-gitea-dark.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,12 @@
212212
--color-code-sidebar-bg: #232834;
213213
--color-shadow: #00000058;
214214
--color-secondary-bg: #2a2e3a;
215-
--color-text-focus: #fff;
216215
--color-expand-button: #3c404d;
217216
--color-placeholder-text: #8a8e99;
218217
--color-editor-line-highlight: var(--color-primary-light-5);
219218
--color-project-board-bg: var(--color-secondary-light-2);
219+
--color-project-board-dark-label: #111111;
220+
--color-project-board-light-label: #eeeeee;
220221
--color-caret: var(--color-text); /* should ideally be --color-text-dark, see #15651 */
221222
--color-reaction-bg: #ffffff12;
222223
--color-reaction-hover-bg: var(--color-primary-light-4);
@@ -225,6 +226,7 @@
225226
--color-tooltip-bg: #000000f0;
226227
--color-nav-bg: #232834;
227228
--color-nav-hover-bg: #383c47;
229+
--color-nav-text: var(--color-text);
228230
--color-label-text: #dfe3ec;
229231
--color-label-bg: #7c84974b;
230232
--color-label-hover-bg: #7c8497a0;

0 commit comments

Comments
 (0)