From ba36937c574d956276eb7dfb2e7ebc0b2cd4151e Mon Sep 17 00:00:00 2001 From: lutinglt Date: Fri, 16 Oct 2026 11:34:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20arc-green=20=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NOTICE | 9 +- THIRD_PARTY_LICENSES.md | 33 +++ assets/theme-arc-green-updated.css | 336 ++++++++++++++++++++++++ package.json | 1 + scripts/updateArcGreen.ts | 40 +++ src/build-output.test.ts | 28 +- theme.config.ts | 54 ++-- themes/arcGreen.ts | 403 +++++++++++++++++++++++++++++ themes/index.ts | 12 +- 9 files changed, 873 insertions(+), 43 deletions(-) create mode 100644 THIRD_PARTY_LICENSES.md create mode 100644 assets/theme-arc-green-updated.css create mode 100644 scripts/updateArcGreen.ts create mode 100644 themes/arcGreen.ts diff --git a/NOTICE b/NOTICE index c46358d8..cdca9a5d 100644 --- a/NOTICE +++ b/NOTICE @@ -4,4 +4,11 @@ Copyright 2024-2026 https://github.com/lutinglt This product includes software developed by https://github.com/lutinglt. This project is licensed under the Apache License, Version 2.0. -See the LICENSE file in the root directory for the full license text. \ No newline at end of file +See the LICENSE file in the root directory for the full license text. + +********************** +THIRD PARTY COMPONENTS +********************** +This software includes third party software subject to the following copyrights: +- Gitea - https://github.com/go-gitea/gitea +- Gitea Theme - https://github.com/lsd-techno/gitea-theme diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md new file mode 100644 index 00000000..38a66c03 --- /dev/null +++ b/THIRD_PARTY_LICENSES.md @@ -0,0 +1,33 @@ +# Third-Party Licenses + +This project is licensed under the Apache License 2.0 (see [LICENSE](./LICENSE) and [NOTICE](./NOTICE)). The third-party +works below keep their original copyright and are licensed under the MIT License; the license text is at the end. + +- **go-gitea/gitea** — + - Files: `gitea/` + - Copyright (c) 2016 The Gitea Authors, Copyright (c) 2015 The Gogs Authors +- **lsd-techno/gitea-theme** — + - Files: `assets/theme-arc-green-updated.css` + - Copyright (c) 2024 lsd-techno + +## MIT License + +```text +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` diff --git a/assets/theme-arc-green-updated.css b/assets/theme-arc-green-updated.css new file mode 100644 index 00000000..7082a0b5 --- /dev/null +++ b/assets/theme-arc-green-updated.css @@ -0,0 +1,336 @@ +@import "./chroma/dark.css"; +@import "./codemirror/dark.css"; + +:root { + --is-dark-theme: true; + --color-primary: #87ab63; + --color-primary-contrast: #ffffff; + --color-primary-dark-1: #93b373; + --color-primary-dark-2: #9fbc82; + --color-primary-dark-3: #abc492; + --color-primary-dark-4: #b7cda1; + --color-primary-dark-5: #cfddc1; + --color-primary-dark-6: #e7eee0; + --color-primary-dark-7: #f8faf6; + --color-primary-light-1: #7a9e55; + --color-primary-light-2: #6c8c4c; + --color-primary-light-3: #5f7b42; + --color-primary-light-4: #516939; + --color-primary-light-5: #364626; + --color-primary-light-6: #1b2313; + --color-primary-light-7: #080b06; + --color-primary-alpha-10: #87ab6319; + --color-primary-alpha-20: #87ab6333; + --color-primary-alpha-30: #87ab634b; + --color-primary-alpha-40: #87ab6366; + --color-primary-alpha-50: #87ab6380; + --color-primary-alpha-60: #87ab6399; + --color-primary-alpha-70: #87ab63b3; + --color-primary-alpha-80: #87ab63cc; + --color-primary-alpha-90: #87ab63e1; + --color-primary-hover: var(--color-primary-light-1); + --color-primary-active: var(--color-primary-light-2); + --color-secondary: #525767; + --color-secondary-dark-1: #5c6374; + --color-secondary-dark-2: #666e81; + --color-secondary-dark-3: #7c8497; + --color-secondary-dark-4: #8990a1; + --color-secondary-dark-5: #959cab; + --color-secondary-dark-6: #a2a8b5; + --color-secondary-dark-7: #afb4c0; + --color-secondary-dark-8: #bcc0ca; + --color-secondary-dark-9: #c9cbd4; + --color-secondary-dark-10: #d6d7de; + --color-secondary-dark-11: #e2e3e8; + --color-secondary-dark-12: #eeeff2; + --color-secondary-dark-13: #fbfbfc; + --color-secondary-light-1: #454a57; + --color-secondary-light-2: #383c47; + --color-secondary-light-3: #2c2f37; + --color-secondary-light-4: #1f2226; + --color-secondary-alpha-10: #52576719; + --color-secondary-alpha-20: #52576733; + --color-secondary-alpha-30: #5257674b; + --color-secondary-alpha-40: #52576766; + --color-secondary-alpha-50: #52576780; + --color-secondary-alpha-60: #52576799; + --color-secondary-alpha-70: #525767b3; + --color-secondary-alpha-80: #525767cc; + --color-secondary-alpha-90: #525767e1; + --color-secondary-button: var(--color-secondary-dark-4); + --color-secondary-hover: var(--color-secondary-dark-3); + --color-secondary-active: var(--color-secondary-dark-2); + /* console colors - used for actions console and console files */ + --color-console-fg: #eeeff2; + --color-console-fg-subtle: #959cab; + --color-console-bg: #262936; + --color-console-border: #383c47; + --color-console-hover-bg: #ffffff16; + --color-console-active-bg: #454a57; + --color-console-menu-bg: #383c47; + --color-console-menu-border: #5c6374; + --color-console-link: #969aa1; + /* named colors */ + --color-red: #cc4848; + --color-orange: #cc580c; + --color-yellow: #cc9903; + --color-olive: #91a313; + --color-green: #87ab63; + --color-teal: #00918a; + --color-blue: #3a8ac6; + --color-violet: #906ae1; + --color-purple: #b259d0; + --color-pink: #d22e8b; + --color-brown: #a47252; + --color-black: #2e323e; + /* light variants - produced via Sass scale-color(color, $lightness: +10%) */ + --color-red-light: #d15a5a; + --color-orange-light: #f6a066; + --color-yellow-light: #eaaf03; + --color-olive-light: #abc016; + --color-green-light: #93b373; + --color-teal-light: #00b6ad; + --color-blue-light: #4e96cc; + --color-violet-light: #9b79e4; + --color-purple-light: #ba6ad5; + --color-pink-light: #d74397; + --color-brown-light: #b08061; + /* dark 1 variants - produced via Sass scale-color(color, $lightness: -10%) */ + --color-black-light: #3f4555; + --color-red-dark-1: #c23636; + --color-orange-dark-1: #f38236; + --color-yellow-dark-1: #b88a03; + --color-olive-dark-1: #839311; + --color-green-dark-1: #7a9e55; + --color-teal-dark-1: #00837c; + --color-blue-dark-1: #347cb3; + --color-violet-dark-1: #7b4edb; + --color-purple-dark-1: #a742c9; + --color-pink-dark-1: #be297d; + --color-brown-dark-1: #94674a; + --color-black-dark-1: #292d38; + /* dark 2 variants - produced via Sass scale-color(color, $lightness: -20%) */ + --color-red-dark-2: #ad3030; + --color-orange-dark-2: #f16e17; + --color-yellow-dark-2: #a37a02; + --color-olive-dark-2: #74820f; + --color-green-dark-2: #6c8c4c; + --color-teal-dark-2: #00746e; + --color-blue-dark-2: #2e6e9f; + --color-violet-dark-2: #6733d6; + --color-purple-dark-2: #9834b9; + --color-pink-dark-2: #a9246f; + --color-brown-dark-2: #835b42; + --color-black-dark-2: #252832; + /* ansi colors used for actions console and console files */ + --color-ansi-black: var(--color-black); + --color-ansi-red: var(--color-red); + --color-ansi-green: var(--color-green); + --color-ansi-yellow: var(--color-yellow); + --color-ansi-blue: var(--color-blue); + --color-ansi-magenta: var(--color-pink); + --color-ansi-cyan: var(--color-teal); + --color-ansi-white: var(--color-console-fg-subtle); + --color-ansi-bright-black: var(--color-black-light); + --color-ansi-bright-red: var(--color-red-light); + --color-ansi-bright-green: var(--color-green-light); + --color-ansi-bright-yellow: var(--color-yellow-light); + --color-ansi-bright-blue: var(--color-blue-light); + --color-ansi-bright-magenta: var(--color-pink-light); + --color-ansi-bright-cyan: var(--color-teal-light); + --color-ansi-bright-white: var(--color-console-fg); + /* 16-color series */ + --color-series-16-0: #7db233; + --color-series-16-1: #499a37; + --color-series-16-2: #ce4751; + --color-series-16-3: #8f9121; + --color-series-16-4: #ac32a6; + --color-series-16-5: #7445e9; + --color-series-16-6: #c67d28; + --color-series-16-7: #4db392; + --color-series-16-8: #aa4d30; + --color-series-16-9: #2a6f84; + --color-series-16-10: #c45327; + --color-series-16-11: #3d965c; + --color-series-16-12: #792a93; + --color-series-16-13: #439d73; + --color-series-16-14: #103aad; + --color-series-16-15: #982e85; + /* other colors */ + --color-grey: #505665; + --color-grey-light: #a1a6b7; + --color-gold: #b1983b; + --color-white: #ffffff; + --color-diff-added-linenum-bg: #3c653c; + --color-diff-added-row-bg: #283e2d; + --color-diff-added-row-border: #314a37; + --color-diff-added-word-bg: #3c653c; + --color-diff-moved-row-bg: #818044; + --color-diff-moved-row-border: #bcca6f; + --color-diff-removed-linenum-bg: #6f3333; + --color-diff-removed-row-bg: #3c2626; + --color-diff-removed-row-border: #634343; + --color-diff-removed-word-bg: #6f3333; + --color-diff-inactive: #353846; + --color-diff-added-fg: var(--color-green); + --color-diff-removed-fg: var(--color-red); + --color-error-border: #a04141; + --color-error-bg: #522; + --color-error-bg-active: #744; + --color-error-bg-hover: #633; + --color-error-text: #f9cbcb; + --color-success-border: #458a57; + --color-success-bg: #284034; + --color-success-text: #6cc664; + --color-warning-border: #bb9d00; + --color-warning-bg: #3a3a30; + --color-warning-text: #fbbd08; + --color-info-border: #306090; + --color-info-bg: #26354c; + --color-info-text: #38a8e8; + --color-red-badge: #db2828; + --color-red-badge-bg: #db28281a; + --color-red-badge-hover-bg: #db28284d; + --color-green-badge: #21ba45; + --color-green-badge-bg: #21ba451a; + --color-green-badge-hover-bg: #21ba454d; + --color-yellow-badge: #fbbd08; + --color-yellow-badge-bg: #fbbd081a; + --color-yellow-badge-hover-bg: #fbbd084d; + --color-orange-badge: #f2711c; + --color-orange-badge-bg: #f2711c1a; + --color-orange-badge-hover-bg: #f2711c4d; + --color-git: #f05133; + --color-logo: #609926; + /* target-based colors */ + --color-body: #2e323e; + --color-box-header: #303340; + --color-box-body: #222733; + --color-box-body-highlight: #262b36; + --color-text-dark: #dbe0ea; + --color-text: #cbd0da; + --color-text-light: #bbbfca; + --color-text-light-1: #aaafb9; + --color-text-light-2: #9a9ea9; + --color-text-light-3: #8a8e99; + --color-footer: #232834; + --color-timeline: #4c525e; + --color-input-text: #dfe3ec; + --color-input-background: #1e252e; + --color-input-toggle-background: #454a57; + --color-input-border: var(--color-secondary); + --color-input-border-hover: var(--color-secondary-dark-1); + --color-light: #00000028; + --color-light-mimic-enabled: rgba(0, 0, 0, calc(40 / 255 * 222 / 255 / var(--opacity-disabled))); + --color-light-border: #ffffff28; + --color-hover: #ffffff19; + --color-hover-opaque: #434651; /* color-mix(--color-body, --color-hover) */ + --color-active: #ffffff24; + --color-menu: #1e252e; + --color-card: #1e252e; + --color-markup-table-row: #ffffff06; + --color-markup-code-block: #ffffff16; + --color-markup-code-inline: #2e4433; + --color-button: #1e252e; + --color-code-bg: #222733; + --color-shadow: #00000058; + --color-shadow-opaque: #000000; + --color-secondary-bg: #2a2e3a; + --color-expand-button: #3c404d; + --color-placeholder-text: #8a8e99; + --color-editor-line-highlight: var(--color-primary-light-5); + --color-editor-selection: var(--color-primary-alpha-50); + --color-project-board-bg: var(--color-secondary-light-2); + --color-project-column-bg: var(--color-secondary-light-2); + --color-caret: var(--color-text); /* should ideally be --color-text-dark, see #15651 */ + --color-reaction-bg: #ffffff12; + --color-reaction-hover-bg: var(--color-primary-light-4); + --color-reaction-active-bg: var(--color-primary-light-5); + --color-tooltip-text: #ffffff; + --color-tooltip-bg: #000000f0; + --color-nav-bg: #232834; + --color-nav-hover-bg: #383c47; + --color-nav-text: var(--color-text); + --color-secondary-nav-bg: #232834; + --color-label-text: #dfe3ec; + --color-label-bg: #7c84974b; + --color-label-hover-bg: #7c8497a0; + --color-label-active-bg: #7c8497ff; + --color-accent: var(--color-primary-light-1); + --color-small-accent: var(--color-primary-light-5); + --color-highlight-fg: #7a9e55; + --color-highlight-bg: #364626; + --color-overlay-backdrop: #080808c0; + --color-danger: var(--color-red); + --color-transparency-grid-light: #3a3e4a; + --color-transparency-grid-dark: #2a2e3a; + --color-workflow-edge-hover: #5c6374; + /* syntax highlighting colors — used by codeeditor.css (CM6) and chroma.css */ + --color-syntax-keyword: #ff7540; + --color-syntax-bool: #649bc4; + --color-syntax-control: #ffaa10; + --color-syntax-name: #fabd2f; + --color-syntax-type: #ff7b72; + --color-syntax-number: #649bc4; + --color-syntax-operator: #ff7540; + --color-syntax-regexp: #9075cd; + --color-syntax-string: #b8bb26; + --color-syntax-comment: #777e94; + --color-syntax-invalid: #ff4433; + --color-syntax-link: var(--color-primary); + --color-syntax-tag: #ff7540; + --color-syntax-attribute: #fabd2f; + --color-syntax-property: #a0cc75; + --color-syntax-variable: #ebdbb2; + --color-syntax-string-special: #ffaa10; + --color-syntax-escape: #ff8540; + --color-syntax-entity: #fabd2f; + --color-syntax-preproc: #8ec07c; + --color-syntax-preproc-file: #649bc4; + --color-syntax-decorator: #8ec07c; + --color-syntax-namespace: #c9d1d9; + --color-syntax-name-pseudo: #fabd2f; + --color-syntax-comment-special: #9075cd; + --color-syntax-text: #c9d1d9; + --color-syntax-text-alt: #b6bac5; + --color-syntax-punctuation: #d2d4db; + --color-syntax-whitespace: #7f8699; + --color-syntax-diff-fg: #ffffff; + --color-syntax-deleted-bg: #5f3737; + --color-syntax-inserted-bg: #3a523a; + --color-syntax-emph: #ddee30; + --color-syntax-strong: #ebdbb2; + --color-syntax-heading: #ffaa10; + --color-syntax-subheading: #b8bb26; + --color-syntax-output: #777e94; + --color-syntax-prompt: #ebdbb2; + --color-syntax-traceback: #ff7540; + --color-syntax-matching-bracket-bg: #00918a48; + --color-syntax-nonmatching-bracket-bg: #cc484848; + accent-color: var(--color-accent); + color-scheme: dark; +} + +/* invert emojis that are hard to read otherwise */ +.emoji[aria-label="check mark"], +.emoji[aria-label="currency exchange"], +.emoji[aria-label="TOP arrow"], +.emoji[aria-label="END arrow"], +.emoji[aria-label="ON! arrow"], +.emoji[aria-label="SOON arrow"], +.emoji[aria-label="heavy dollar sign"], +.emoji[aria-label="copyright"], +.emoji[aria-label="registered"], +.emoji[aria-label="trade mark"], +.emoji[aria-label="multiply"], +.emoji[aria-label="plus"], +.emoji[aria-label="minus"], +.emoji[aria-label="divide"], +.emoji[aria-label="curly loop"], +.emoji[aria-label="double curly loop"], +.emoji[aria-label="wavy dash"], +.emoji[aria-label="paw prints"], +.emoji[aria-label="musical note"], +.emoji[aria-label="musical notes"] { + filter: invert(100%) hue-rotate(180deg); +} diff --git a/package.json b/package.json index 5ba1ccde..36355847 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "update:primer": "bun scripts/buildPrimerTSToken.ts", "update:locale": "bun scripts/translate.ts", "update:gitea": "bun scripts/updateGitea.ts", + "update:arcgreen": "bun scripts/updateArcGreen.ts", "update:snapshot": "bun vitest --update", "install:clean": "rm -rf node_modules bun.lock bun.lockb && bun install" }, diff --git a/scripts/updateArcGreen.ts b/scripts/updateArcGreen.ts new file mode 100644 index 00000000..ef58f2d9 --- /dev/null +++ b/scripts/updateArcGreen.ts @@ -0,0 +1,40 @@ +/*! + * Copyright (c) https://github.com/lutinglt + * + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import fs from "node:fs"; +import path from "node:path"; +import { rootDir, setGlobalProxy } from "./utils"; + +setGlobalProxy(); + +const githubSite = "https://raw.githubusercontent.com"; +const githubRepo = "lsd-techno/gitea-theme"; +const githubBranchPath = "refs/heads/main"; +const localGiteaPath = path.join(rootDir, "assets"); +const githubBaseUrl = `${githubSite}/${githubRepo}/${githubBranchPath}`; +const file = "theme-arc-green-updated.css"; +const fileUrl = `${githubBaseUrl}/${file}`; + +const response = await fetch(fileUrl); +if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); +} +const content = await response.text(); +fs.writeFileSync(path.join(localGiteaPath, file), content); +console.log("✔︎ FileUrl:", fileUrl); diff --git a/src/build-output.test.ts b/src/build-output.test.ts index e7aa1967..554d89c4 100644 --- a/src/build-output.test.ts +++ b/src/build-output.test.ts @@ -47,6 +47,19 @@ const EXPECTED_THEME_FILES = [ `${PREFIX}tritanopia-dark.css`, `${PREFIX}tritanopia-light.css`, `${PREFIX}tritanopia-auto.css`, + // high contrast + `${PREFIX}high-contrast-dark.css`, + `${PREFIX}high-contrast-light.css`, + `${PREFIX}high-contrast-soft-dark.css`, + `${PREFIX}high-contrast-auto.css`, + // high contrast colorblind + `${PREFIX}high-contrast-colorblind-dark.css`, + `${PREFIX}high-contrast-colorblind-light.css`, + `${PREFIX}high-contrast-colorblind-auto.css`, + // high contrast tritanopia + `${PREFIX}high-contrast-tritanopia-dark.css`, + `${PREFIX}high-contrast-tritanopia-light.css`, + `${PREFIX}high-contrast-tritanopia-auto.css`, // pink `${PREFIX}pink-dark.css`, `${PREFIX}pink-light.css`, @@ -62,19 +75,8 @@ const EXPECTED_THEME_FILES = [ `${PREFIX}catppuccin-frappe.css`, `${PREFIX}catppuccin-macchiato.css`, `${PREFIX}catppuccin-auto.css`, - // high contrast - `${PREFIX}high-contrast-dark.css`, - `${PREFIX}high-contrast-light.css`, - `${PREFIX}high-contrast-soft-dark.css`, - `${PREFIX}high-contrast-auto.css`, - // high contrast colorblind - `${PREFIX}high-contrast-colorblind-dark.css`, - `${PREFIX}high-contrast-colorblind-light.css`, - `${PREFIX}high-contrast-colorblind-auto.css`, - // high contrast tritanopia - `${PREFIX}high-contrast-tritanopia-dark.css`, - `${PREFIX}high-contrast-tritanopia-light.css`, - `${PREFIX}high-contrast-tritanopia-auto.css`, + // arc green + `${PREFIX}arc-green.css` ]; /** auto 主题文件名列表 */ diff --git a/theme.config.ts b/theme.config.ts index e4ab3470..a48c4135 100644 --- a/theme.config.ts +++ b/theme.config.ts @@ -64,30 +64,6 @@ export default defineThemeConfig({ }, }, }, - { - themeSeriesName: "pink", - themes: { - dark: { theme: themes.github.pink.dark }, - light: { theme: themes.github.pink.light }, - "soft-dark": { theme: themes.github.pink.softDark }, - }, - }, - { - themeSeriesName: "gitea", - themes: { - dark: { theme: themes.gitea.dark }, - light: { theme: themes.gitea.light }, - }, - }, - { - themeSeriesName: "catppuccin", - themes: { - dark: { themeName: "mocha", theme: themes.catppuccin.mocha }, - light: { themeName: "latte", theme: themes.catppuccin.latte }, - frappe: { theme: themes.catppuccin.frappe }, - macchiato: { theme: themes.catppuccin.macchiato }, - }, - }, { themeSeriesName: "high-contrast", themes: { @@ -128,5 +104,35 @@ export default defineThemeConfig({ }, }, }, + { + themeSeriesName: "pink", + themes: { + dark: { theme: themes.github.pink.dark }, + light: { theme: themes.github.pink.light }, + "soft-dark": { theme: themes.github.pink.softDark }, + }, + }, + { + themeSeriesName: "gitea", + themes: { + dark: { theme: themes.gitea.dark }, + light: { theme: themes.gitea.light }, + }, + }, + { + themeSeriesName: "catppuccin", + themes: { + dark: { themeName: "mocha", theme: themes.catppuccin.mocha }, + light: { themeName: "latte", theme: themes.catppuccin.latte }, + frappe: { theme: themes.catppuccin.frappe }, + macchiato: { theme: themes.catppuccin.macchiato }, + }, + }, + { + themeSeriesName: "arc", + themes: { + dark: { themeName: "green", theme: themes.arcGreen }, + }, + }, ], }); diff --git a/themes/arcGreen.ts b/themes/arcGreen.ts new file mode 100644 index 00000000..96656bfb --- /dev/null +++ b/themes/arcGreen.ts @@ -0,0 +1,403 @@ +// SPDX-License-Identifier: Apache-2.0 AND MIT + +/*! + * Copyright (c) https://github.com/lutinglt + * + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*! + * MIT License + * + * Copyright (c) 2024 lsd-techno + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/** + * @copyright lsd-techno + * @source https://github.com/lsd-techno/gitea-theme + * @author lutinglt + */ + +import type { + Ansi, + Console, + Diff, + GiteaColor, + Message, + Named, + Other, + Primary, + Secondary, + Series16, + Syntax, +} from "@lutinglt/gitea-github-theme/core"; +import { defineTheme, themeVars } from "@lutinglt/gitea-github-theme/core"; + +const primary: Primary = { + self: "#87ab63", + contrast: "#ffffff", + dark: { + num1: "#93b373", + num2: "#9fbc82", + num3: "#abc492", + num4: "#b7cda1", + num5: "#cfddc1", + num6: "#e7eee0", + num7: "#f8faf6", + }, + light: { + num1: "#7a9e55", + num2: "#6c8c4c", + num3: "#5f7b42", + num4: "#516939", + num5: "#364626", + num6: "#1b2313", + num7: "#080b06", + }, + alpha: { + num10: "#87ab6319", + num20: "#87ab6333", + num30: "#87ab634b", + num40: "#87ab6366", + num50: "#87ab6380", + num60: "#87ab6399", + num70: "#87ab63b3", + num80: "#87ab63cc", + num90: "#87ab63e1", + }, + hover: themeVars.color.primary.light.num1, + active: themeVars.color.primary.light.num2, +}; +const secondary: Secondary = { + self: "#525767", + dark: { + num1: "#5c6374", + num2: "#666e81", + num3: "#7c8497", + num4: "#8990a1", + num5: "#959cab", + num6: "#a2a8b5", + num7: "#afb4c0", + num8: "#bcc0ca", + num9: "#c9cbd4", + num10: "#d6d7de", + num11: "#e2e3e8", + num12: "#eeeff2", + num13: "#fbfbfc", + }, + light: { + num1: "#454a57", + num2: "#383c47", + num3: "#2c2f37", + num4: "#1f2226", + }, + alpha: { + num10: "#52576719", + num20: "#52576733", + num30: "#5257674b", + num40: "#52576766", + num50: "#52576780", + num60: "#52576799", + num70: "#525767b3", + num80: "#525767cc", + num90: "#525767e1", + }, + button: themeVars.color.secondary.dark.num4, + hover: themeVars.color.secondary.dark.num3, + active: themeVars.color.secondary.dark.num2, +}; +const console: Console = { + fg: { + self: "#eeeff2", + subtle: "#959cab", + }, + bg: "#262936", + activeBg: "#454a57", + hoverBg: "#ffffff16", + link: "#969aa1", +}; +const named: Named = { + red: { + self: "#cc4848", + light: "#d15a5a", + dark: { num1: "#c23636", num2: "#ad3030" }, + badge: { self: "#db2828", bg: "#db28281a", hover: { bg: "#db28284d" } }, + }, + orange: { + self: "#cc580c", + light: "#f6a066", + dark: { num1: "#f38236", num2: "#f16e17" }, + badge: { self: "#f2711c", bg: "#f2711c1a", hover: { bg: "#f2711c4d" } }, + }, + yellow: { + self: "#cc9903", + light: "#eaaf03", + dark: { num1: "#b88a03", num2: "#a37a02" }, + badge: { self: "#fbbd08", bg: "#fbbd081a", hover: { bg: "#fbbd084d" } }, + }, + olive: { self: "#91a313", light: "#abc016", dark: { num1: "#839311", num2: "#74820f" } }, + green: { + self: "#87ab63", + light: "#93b373", + dark: { num1: "#7a9e55", num2: "#6c8c4c" }, + badge: { self: "#21ba45", bg: "#21ba451a", hover: { bg: "#21ba454d" } }, + }, + teal: { self: "#00918a", light: "#00b6ad", dark: { num1: "#00837c", num2: "#00746e" } }, + blue: { self: "#3a8ac6", light: "#4e96cc", dark: { num1: "#347cb3", num2: "#2e6e9f" } }, + violet: { self: "#906ae1", light: "#9b79e4", dark: { num1: "#7b4edb", num2: "#6733d6" } }, + purple: { self: "#b259d0", light: "#ba6ad5", dark: { num1: "#a742c9", num2: "#9834b9" } }, + pink: { self: "#d22e8b", light: "#d74397", dark: { num1: "#be297d", num2: "#a9246f" } }, + brown: { self: "#a47252", light: "#b08061", dark: { num1: "#94674a", num2: "#835b42" } }, + black: { self: "#2e323e", light: "#3f4555", dark: { num1: "#292d38", num2: "#252832" } }, + grey: { self: "#505665", light: "#a1a6b7" }, + gold: "#b1983b", + white: "#ffffff", +}; +const ansi: Ansi = { + black: themeVars.color.black.self, + red: themeVars.color.red.self, + green: themeVars.color.green.self, + yellow: themeVars.color.yellow.self, + blue: themeVars.color.blue.self, + magenta: themeVars.color.pink.self, + cyan: themeVars.color.teal.self, + white: themeVars.color.console.fg.subtle, + bright: { + black: themeVars.color.black.light, + red: themeVars.color.red.light, + green: themeVars.color.green.light, + yellow: themeVars.color.yellow.light, + blue: themeVars.color.blue.light, + magenta: themeVars.color.pink.light, + cyan: themeVars.color.teal.light, + white: themeVars.color.console.fg.self, + }, +}; +const diff: Diff = { + added: { + fg: themeVars.color.green.self, + linenum: { bg: "#3c653c" }, + row: { bg: "#283e2d", border: "#314a37" }, + word: { bg: "#3c653c" }, + }, + moved: { + row: { bg: "#818044", border: "#bcca6f" }, + }, + removed: { + fg: themeVars.color.red.self, + linenum: { bg: "#6f3333" }, + row: { bg: "#3c2626", border: "#634343" }, + word: { bg: "#6f3333" }, + }, + inactive: "#353846", +}; +const message: Message = { + error: { + bg: { self: "#552222", active: "#774444", hover: "#663333" }, + border: "#a04141", + text: "#f9cbcb", + }, + success: { + bg: "#284034", + border: "#458a57", + text: "#6cc664", + }, + warning: { + bg: "#3a3a30", + border: "#bb9d00", + text: "#fbbd08", + }, + info: { + bg: "#26354c", + border: "#306090", + text: "#38a8e8", + }, + // 源主题 CSS 中未提供优先级提示色, 这里按主题的紫色系推导 + priority: { + bg: "#281e38", + border: "#522a92", + text: "#b89de4", + }, +}; +const other: Other = { + logo: "#609926", + body: "#2e323e", + footer: "#232834", + timeline: "#4c525e", + box: { + header: "#303340", + body: { self: "#222733", highlight: "#262b36" }, + }, + text: { + self: "#cbd0da", + light: { self: "#bbbfca", num1: "#aaafb9", num2: "#9a9ea9", num3: "#8a8e99" }, + dark: "#dbe0ea", + }, + input: { + text: "#dfe3ec", + background: "#1e252e", + toggleBackground: "#454a57", + border: themeVars.color.secondary.self, + }, + light: { self: "#00000028", border: "#ffffff28" }, + hover: { self: "#ffffff19", opaque: "#434651" }, + active: "#ffffff24", + menu: "#1e252e", + card: "#1e252e", + markup: { + tableRow: "#ffffff06", + code: { block: "#ffffff16", inline: "#2e4433" }, + }, + button: "#1e252e", + codeBg: "#222733", + shadow: { self: "#00000058", opaque: "#000000" }, + secondaryBg: "#2a2e3a", + expandButton: "#3c404d", + placeholderText: "#8a8e99", + editor: { + lineHighlight: themeVars.color.primary.light.num5, + selection: themeVars.color.primary.alpha.num50, + }, + projectColumnBg: themeVars.color.secondary.light.num2, + caret: themeVars.color.text.self, + reaction: { + bg: "#ffffff12", + hoverBg: themeVars.color.primary.light.num4, + activeBg: themeVars.color.primary.light.num5, + }, + tooltip: { text: "#ffffff", bg: "#000000f0" }, + nav: { + bg: "#232834", + hoverBg: "#383c47", + text: themeVars.color.text.self, + }, + secondaryNavBg: "#232834", + label: { + text: "#dfe3ec", + bg: "#7c84974b", + hoverBg: "#7c8497a0", + activeBg: "#7c8497ff", + }, + accent: themeVars.color.primary.light.num1, + smallAccent: themeVars.color.primary.light.num5, + highlight: { fg: "#7a9e55", bg: "#364626" }, + overlayBackdrop: "#080808c0", + danger: themeVars.color.red.self, + transparency: { grid: { light: "#3a3e4a", dark: "#2a2e3a" } }, + // workflowEdgeHover: "#5c6374", + // 此颜色在 Gitea 中使用在 1.27 版本中出现偏差, CSS 高亮使用 primary 覆盖, 这里还原视觉效果与主题文件有偏差 + workflowEdgeHover: primary.self, +}; + +const series16: Series16 = { + num0: "#7db233", + num1: "#499a37", + num2: "#ce4751", + num3: "#8f9121", + num4: "#ac32a6", + num5: "#7445e9", + num6: "#c67d28", + num7: "#4db392", + num8: "#aa4d30", + num9: "#2a6f84", + num10: "#c45327", + num11: "#3d965c", + num12: "#792a93", + num13: "#439d73", + num14: "#103aad", + num15: "#982e85", +}; + +export const arcGreenColor: GiteaColor = { + isDarkTheme: true, + primary, + secondary, + named, + message, + ansi, + console, + diff, + other, + series16, +}; + +export const arcGreenSyntax: Syntax = { + keyword: "#ff7540", + bool: "#649bc4", + control: "#ffaa10", + name: "#fabd2f", + type: "#ff7b72", + number: "#649bc4", + operator: "#ff7540", + regexp: "#9075cd", + string: "#b8bb26", + comment: "#777e94", + invalid: "#ff4433", + link: themeVars.color.primary.self, + tag: "#ff7540", + attribute: "#fabd2f", + property: "#a0cc75", + variable: "#ebdbb2", + stringSpecial: "#ffaa10", + escape: "#ff8540", + entity: "#fabd2f", + preproc: "#8ec07c", + preprocFile: "#649bc4", + decorator: "#8ec07c", + namespace: "#c9d1d9", + namePseudo: "#fabd2f", + commentSpecial: "#9075cd", + text: "#c9d1d9", + textAlt: "#b6bac5", + punctuation: "#d2d4db", + whitespace: "#7f8699", + diffFg: "#ffffff", + deletedBg: "#5f3737", + insertedBg: "#3a523a", + emph: "#ddee30", + strong: "#ebdbb2", + heading: "#ffaa10", + subheading: "#b8bb26", + output: "#777e94", + prompt: "#ebdbb2", + traceback: "#ff7540", + matchingBracketBg: "#00918a48", + nonmatchingBracketBg: "#cc484848", +}; + +export const arcGreenTheme = defineTheme({ + colorType: "gitea", + themeColor: arcGreenColor, + syntaxColor: arcGreenSyntax, +}); diff --git a/themes/index.ts b/themes/index.ts index 4c5f88c3..91bbdf08 100644 --- a/themes/index.ts +++ b/themes/index.ts @@ -44,6 +44,7 @@ import { githubTritanopiaDarkTheme, githubTritanopiaLightTheme, } from "./github"; +import { arcGreenTheme } from "./arcGreen"; export const giteaColor = { dark: giteaDarkColor, @@ -63,11 +64,6 @@ export default { dark: githubTritanopiaDarkTheme, light: githubTritanopiaLightTheme, }, - pink: { - dark: githubPinkDarkTheme, - light: githubPinkLightTheme, - softDark: githubPinkSoftDarkTheme, - }, highContrast: { dark: githubDarkHighContrastTheme, light: githubLightHighContrastTheme, @@ -81,6 +77,11 @@ export default { light: githubLightTritanopiaHighContrastTheme, }, }, + pink: { + dark: githubPinkDarkTheme, + light: githubPinkLightTheme, + softDark: githubPinkSoftDarkTheme, + }, }, gitea: { dark: giteaDarkTheme, @@ -92,4 +93,5 @@ export default { macchiato: catppuccinMacchiatoTheme, mocha: catppuccinMochaTheme, }, + arcGreen: arcGreenTheme, }; From c793c5ed2fc8c83d23752398b041328c8d436e82 Mon Sep 17 00:00:00 2001 From: lutinglt Date: Fri, 16 Oct 2026 11:37:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B0=86=20assets=20=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E4=B8=BA=20linguist-generated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 1e4e0f9b..b9503ab5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,7 @@ # 忽略非项目代码统计 .github/** linguist-vendored .vscode/** linguist-generated +assets/** linguist-generated dist/** linguist-generated gitea/** linguist-generated primer/** linguist-generated