fix(theme): repair broken theme + MokoOnyx surface separation #800

Merged
jmiller merged 2 commits from jmiller/fix-theme-config-separation AGit into dev 2026-07-17 15:42:47 +00:00
6 changed files with 68 additions and 5 deletions
+3 -3
View File
@@ -86,9 +86,9 @@ type AppVersion struct {
func NewMainApp(appVer AppVersion) *cli.Command {
app := &cli.Command{}
app.Name = "gitea" // must be lower-cased because it appears in the "USAGE" section like "gitea doctor [command [command options]]"
app.Name = "mokogit" // must be lower-cased because it appears in the "USAGE" section like "mokogit doctor [command [command options]]" and in `mokogit --version`
app.Usage = "A painless self-hosted Git service"
app.Description = `Gitea program contains "web" and other subcommands. If no subcommand is given, it starts the web server by default. Use "web" subcommand for more web server arguments, use other subcommands for other purposes.`
app.Description = `MokoGIT program contains "web" and other subcommands. If no subcommand is given, it starts the web server by default. Use "web" subcommand for more web server arguments, use other subcommands for other purposes.`
app.Version = appVer.Version + appVer.Extra
app.EnableShellCompletion = true
app.Flags = []cli.Flag{
@@ -96,7 +96,7 @@ func NewMainApp(appVer AppVersion) *cli.Command {
Name: "work-path",
Aliases: []string{"w"},
TakesFile: true,
Usage: "Set Gitea's working path (defaults to the Gitea's binary directory)",
Usage: "Set MokoGIT's working path (defaults to the MokoGIT's binary directory)",
},
&cli.StringFlag{
Name: "config",
+2 -2
View File
@@ -1346,8 +1346,8 @@ LEVEL = Info
;; Whether the email of the user should be shown in the Explore Users page
;SHOW_USER_EMAIL = true
;;
;; Set the default theme for the Gitea install
;DEFAULT_THEME = gitea-auto
;; Set the default theme for the MokoGIT install
;DEFAULT_THEME = mokogit-auto
;;
;; All available themes. Allow users select personalized themes regardless of the value of `DEFAULT_THEME`.
;; Leave it empty to allow users to select any theme from "{CustomPath}/public/assets/css/theme-*.css"
+1
View File
@@ -447,6 +447,7 @@ func prepareMigrationTasks() []*migration {
newMigration(367, "Add user allowlists to org protected branch", v1_27.AddUserAllowlistsToOrgProtectedBranch),
newMigration(368, "Drop org from repo manifest (derived from org profile)", v1_27.DropOrgFromRepoManifest),
newMigration(369, "Rename mokogitea-actions system user to mokogit-actions", v1_27.RenameActionsUserToMokoGit),
newMigration(370, "Remap saved gitea-* user themes to mokogit-*", v1_27.RemapGiteaThemesToMokogit),
}
return preparedMigrations
}
+36
View File
@@ -0,0 +1,36 @@
// Copyright 2026 Moko Consulting <hello@mokoconsulting.tech>
// SPDX-License-Identifier: GPL-3.0-or-later
package v1_27
import "xorm.io/xorm"
// RemapGiteaThemesToMokogit rewrites each user's saved theme from the retired
// upstream "gitea-*" theme names to their "mokogit-*" equivalents, part of the
// MokoGitea -> MokoGIT rebrand. The branding rebrand deleted theme-gitea-*.css,
// so any user still pointing at a gitea-* theme would load a now-missing
// stylesheet (a blank/unstyled page). Each user's light/dark/auto preference is
// preserved; the colorblind variants (which MokoGIT does not ship) collapse to
// the matching base scheme. Idempotent: rows already on a mokogit-* value are
// left untouched by the WHERE clause on the old name.
func RemapGiteaThemesToMokogit(x *xorm.Engine) error {
sess := x.NewSession()
defer sess.Close()
if err := sess.Begin(); err != nil {
return err
}
remap := []struct{ old, new string }{
{"gitea-auto", "mokogit-auto"},
{"gitea-auto-colorblind", "mokogit-auto"},
{"gitea-light", "mokogit-light"},
{"gitea-light-colorblind", "mokogit-light"},
{"gitea-dark", "mokogit-dark"},
{"gitea-dark-colorblind", "mokogit-dark"},
}
for _, m := range remap {
if _, err := sess.Exec("UPDATE `user` SET `theme` = ? WHERE `theme` = ?", m.new, m.old); err != nil {
return err
}
}
return sess.Commit()
}
+14
View File
@@ -310,6 +310,20 @@ gitea-theme-meta-info {
--color-syntax-traceback: #ff8686;
--color-syntax-matching-bracket-bg: #00918a48;
--color-syntax-nonmatching-bracket-bg: #cc484848;
/* ===== MokoOnyx surface separation (navy-tinted elevation) =====
Establish a clear 3-step elevation so panels separate from the page:
page (darkest) -> box body -> box header/secondary (lightest). All tones
are navy-tinted (blue channel raised) to stay cohesive with the #112855
brand nav, mirroring mokoconsulting.tech's dark surface hierarchy. */
--color-body: #0b1017; /* page: deepest navy-black */
--color-box-body: #121a24; /* cards/boxes: lifted, navy-tinted */
--color-box-header: #17212e; /* box headers: lightest surface */
--color-box-body-highlight: #17212e;
--color-secondary-bg: #17212e;
--color-card: #141d28;
--color-menu: #141d28;
--color-button: #141d28;
--color-light-border: #ffffff24; /* more visible panel edges on dark */
accent-color: var(--color-accent);
color-scheme: dark;
}
@@ -310,6 +310,18 @@ gitea-theme-meta-info {
--color-syntax-traceback: #c00000;
--color-syntax-matching-bracket-bg: #00b5ad38;
--color-syntax-nonmatching-bracket-bg: #db282838;
/* ===== MokoOnyx surface separation (mokoconsulting.tech gray scale) =====
Give the page a soft gray base so white cards/boxes visibly lift off it,
with a defined gray-300 border tone for clear panel edges. Mirrors the
surface hierarchy of mokoconsulting.tech (MokoOnyx --gray-100/200/300). */
--color-body: #f0f3f6; /* page: soft gray (was #fff, blended into cards) */
--color-box-body: #ffffff; /* cards/boxes: white, now lift off the gray page */
--color-box-header: #e9edf1; /* box headers: gray-200 tone */
--color-secondary-bg: #e7ebef; /* MokoOnyx gray-200 */
--color-card: #ffffff;
--color-menu: #ffffff;
--color-button: #ffffff;
--color-light-border: #0000172e; /* stronger gray-300 border definition */
accent-color: var(--color-accent);
color-scheme: light;
}