commit 8270112f5d18723b6ae00019d26046f03e46d862 Author: jiulinxiri Date: Tue Aug 22 10:52:54 2023 +0800 项目初始化 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d86ac02 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,34 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# EditorConfig is awesome: https://EditorConfig.org + +root = true + +[*] +charset = utf-8 +indent_size = 2 +indent_style = space +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +# go +[*.go] +indent_style = tab +indent_size = 4 + +# python +[*.{ini,py,py.tpl,rst}] +indent_size = 4 + +# rust +[*.rs] +indent_size = 4 + +# documentation, utils +[*.{md,mdx,diff}] +trim_trailing_whitespace = false + +# windows shell scripts +[*.{cmd,bat,ps1}] +end_of_line = crlf diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a5f25fd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm ci + - run: npm run build + - name: Create tarball + run: tar czf catppuccin-gitea.tar.gz --directory=./dist . + - name: Add zips to release + uses: softprops/action-gh-release@v1 + with: + files: ./catppuccin-gitea.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..df5afb8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,83 @@ +node_modules/ +/dist/ +*.tar.gz +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf +.idea + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..006383b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Catppuccin + +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/README.md b/README.md new file mode 100644 index 0000000..beaa09b --- /dev/null +++ b/README.md @@ -0,0 +1,64 @@ +

+ Logo
+ + Catppuccin for Gitea + +

+ +

+ + + +

+ +

+ +

+ +## Previews + +
+🌻 Latte + +
+
+🪴 Frappé + +
+
+🌺 Macchiato + +
+
+🌿 Mocha + +
+ +## Usage + +1. Download the [latest release](https://github.com/catppuccin/gitea/releases/latest). +2. Place the CSS files in your `$GITEA_CUSTOM/public/css` directory. +3. Add the themes to your [`app.ini`](https://docs.gitea.io/en-us/customizing-gitea/#customizing-the-look-of-gitea). +4. Restart your Gitea instance. +5. Select the theme in Gitea > Account > Settings > Appearance. + +> **Note**\ +> Gitea >1.18 is required for this theme. + +## 💝 Thanks to + +- [winston](https://github.com/nekowinston) + +  + +

+ +

+ +

+ Copyright © 2021-present Catppuccin Org +

+ +

+ +

diff --git a/assets/frappe.webp b/assets/frappe.webp new file mode 100644 index 0000000..e8c1faa Binary files /dev/null and b/assets/frappe.webp differ diff --git a/assets/latte.webp b/assets/latte.webp new file mode 100644 index 0000000..8cbf3ed Binary files /dev/null and b/assets/latte.webp differ diff --git a/assets/macchiato.webp b/assets/macchiato.webp new file mode 100644 index 0000000..15d3b44 Binary files /dev/null and b/assets/macchiato.webp differ diff --git a/assets/mocha.webp b/assets/mocha.webp new file mode 100644 index 0000000..a276e0b Binary files /dev/null and b/assets/mocha.webp differ diff --git a/assets/preview.webp b/assets/preview.webp new file mode 100644 index 0000000..ab29312 Binary files /dev/null and b/assets/preview.webp differ diff --git a/build.js b/build.js new file mode 100644 index 0000000..e16e705 --- /dev/null +++ b/build.js @@ -0,0 +1,46 @@ +const fs = require("fs"); +const path = require("path"); +const sass = require("sass"); +const ctp = require("@catppuccin/palette"); + +const builder = (flavor, accent) => ` +@import "@catppuccin/palette/scss/${flavor}"; +$accent: $${accent}; +$isDark: ${flavor !== "latte"}; +@import "theme"; +`; + +const accents = [ + "rosewater", + "flamingo", + "pink", + "mauve", + "red", + "maroon", + "peach", + "yellow", + "green", + "teal", + "sky", + "sapphire", + "blue", + "lavender", +]; + +for (const flavor of Object.keys(ctp.variants)) { + for (const accent of accents) { + const input = builder(flavor, accent); + const result = sass.compileString(input, { + loadPaths: [ + path.join(__dirname, "src"), + path.join(__dirname, "node_modules"), + ], + }); + + fs.mkdirSync(path.join(__dirname, "dist"), { recursive: true }); + fs.writeFileSync( + path.join(__dirname, "dist", `theme-catppuccin-${flavor}-${accent}.css`), + result.css + ); + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..fad4ade --- /dev/null +++ b/package-lock.json @@ -0,0 +1,161 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@catppuccin/palette": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@catppuccin/palette/-/palette-0.1.8.tgz", + "integrity": "sha512-41quIj08vgPMy8kQxQb0+VqxuTlo2xfNYGSgOuiJXNojWnGuhLxBc61jgu2jiZYGNXVqgVNGWwmWEUf6s32jiA==", + "dev": true + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "immutable": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.2.tgz", + "integrity": "sha512-oGXzbEDem9OOpDWZu88jGiYCvIsLHMvGw+8OXlpsvTFvIQplQbjg1B1cvKg8f7Hoch6+NGjpPsH1Fr+Mc2D1aA==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "sass": { + "version": "1.66.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.66.1.tgz", + "integrity": "sha512-50c+zTsZOJVgFfTgwwEzkjA3/QACgdNsKueWPyAR0mRINIvLAStVQBbPg14iuqEQ74NPDbXzJARJ/O4SI1zftA==", + "dev": true, + "requires": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + } + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..2baecb2 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "devDependencies": { + "@catppuccin/palette": "^0.1.7", + "sass": "^1.60.0" + }, + "scripts": { + "build": "node ./build.js" + } +} diff --git a/src/_chroma.scss b/src/_chroma.scss new file mode 100644 index 0000000..53f153a --- /dev/null +++ b/src/_chroma.scss @@ -0,0 +1,296 @@ +@use "sass:color"; + +/* NameBuiltinPseudo */ +.chroma .bp { + color: $peach; +} +/* Comment */ +.chroma .c { + color: $overlay0; +} +/* CommentSingle */ +.chroma .c1 { + color: $overlay0; +} +/* CommentHashbang */ +.chroma .ch { + color: $overlay0; +} +/* CommentMultiline */ +.chroma .cm { + color: $overlay0; +} +/* CommentPreproc */ +.chroma .cp { + color: $blue; +} +/* CommentPreprocFile */ +.chroma .cpf { + color: $blue; +} +/* CommentSpecial */ +.chroma .cs { + color: $overlay0; +} +/* LiteralStringDelimiter */ +.chroma .dl { + color: $blue; +} +/* NameFunctionMagic */ +.chroma .fm { +} +/* Generic */ +.chroma .g { +} +/* GenericDeleted */ +.chroma .gd { + color: $text; + background-color: color.change($red, $alpha: 0.15); +} +/* GenericEmph */ +.chroma .ge { + font-style: italic; +} +/* GenericHeading */ +.chroma .gh { + color: $sky; +} +/* GenericInserted */ +.chroma .gi { + color: $text; + background-color: color.change($green, $alpha: 0.15); +} +/* GenericUnderline */ +.chroma .gl { +} +/* GenericOutput */ +.chroma .go { + color: $peach; +} +/* GenericPrompt */ +.chroma .gp { + color: $overlay0; + font-weight: bold; +} +/* GenericError */ +.chroma .gr { + color: $maroon; +} +/* GenericStrong */ +.chroma .gs { + font-weight: bold; +} +/* GenericTraceback */ +.chroma .gt { + color: $maroon; +} +/* GenericSubheading */ +.chroma .gu { + color: $sky; +} +/* LiteralNumberIntegerLong */ +.chroma .il { + color: $peach; +} +/* Keyword */ +.chroma .k { + color: $mauve; +} +/* KeywordConstant */ +.chroma .kc { + color: $yellow; +} +/* KeywordDeclaration */ +.chroma .kd { + color: $mauve; +} +/* KeywordNamespace */ +.chroma .kn { + color: $yellow; +} +/* KeywordPseudo */ +.chroma .kp { + color: $mauve; + font-weight: bold; +} +/* KeywordReserved */ +.chroma .kr { + color: $mauve; +} +/* KeywordType */ +.chroma .kt { + color: $yellow; +} +/* Literal */ +.chroma .l { +} +/* LiteralDate */ +.chroma .ld { +} +/* LiteralNumber */ +.chroma .m { + color: $peach; +} +/* LiteralNumberBin */ +.chroma .mb { + color: $peach; +} +/* LiteralNumberFloat */ +.chroma .mf { + color: $peach; +} +/* LiteralNumberHex */ +.chroma .mh { + color: $peach; +} +/* LiteralNumberInteger */ +.chroma .mi { + color: $peach; +} +/* LiteralNumberOct */ +.chroma .mo { + color: $peach; +} +/* Name */ +.chroma .n { + color: $lavender; +} +/* NameAttribute */ +.chroma .na { + color: $yellow; +} +/* NameBuiltin */ +.chroma .nb { + color: $peach; +} +/* NameClass */ +.chroma .nc { + color: $yellow; +} +/* NameDecorator */ +.chroma .nd { + color: $pink; +} +/* NameException */ +.chroma .ne { + color: $maroon; +} +/* NameFunction */ +.chroma .nf { + color: $blue; +} +/* NameEntity */ +.chroma .ni { + color: $pink; +} +/* NameLabel */ +.chroma .nl { + color: $yellow; +} +/* NameNamespace */ +.chroma .nn { + color: $yellow; +} +/* NameConstant */ +.chroma .no { + color: $yellow; +} +/* NameTag */ +.chroma .nt { + color: $mauve; +} +/* NameVariable */ +.chroma .nv { + color: $peach; +} +/* NameOther */ +.chroma .nx { + color: $peach; +} +/* Operator */ +.chroma .o { + color: $sky; +} +/* OperatorWord */ +.chroma .ow { + color: $sky; + font-weight: bold; +} +/* Punctuation */ +.chroma .p { + color: $overlay2; +} +/* NameProperty */ +.chroma .py { +} +/* LiteralString */ +.chroma .s { + color: $green; +} +/* LiteralStringSingle */ +.chroma .s1 { + color: $green; +} +/* LiteralStringDouble */ +.chroma .s2 { + color: $green; +} +/* LiteralStringAffix */ +.chroma .sa { + color: $green; +} +/* LiteralStringBacktick */ +.chroma .sb { + color: $green; +} +/* LiteralStringChar */ +.chroma .sc { + color: $green; +} +/* LiteralStringDoc */ +.chroma .sd { + color: $green; +} +/* LiteralStringEscape */ +.chroma .se { + color: $blue; +} +/* LiteralStringHeredoc */ +.chroma .sh { + color: $green; +} +/* LiteralStringInterpol */ +.chroma .si { + color: $green; +} +/* LiteralStringRegex */ +.chroma .sr { + color: $blue; +} +/* LiteralStringSymbol */ +.chroma .ss { + color: $green; +} +/* LiteralStringOther */ +.chroma .sx { + color: $green; +} +/* NameVariableClass */ +.chroma .vc { + color: $yellow; +} +/* NameVariableGlobal */ +.chroma .vg { + color: $peach; +} +/* NameVariableInstance */ +.chroma .vi { + color: $yellow; +} +/* NameVariableMagic */ +.chroma .vm { +} +/* TextWhitespace */ +.chroma .w { + color: $surface0; +} diff --git a/src/_codemirror.scss b/src/_codemirror.scss new file mode 100644 index 0000000..36a86a2 --- /dev/null +++ b/src/_codemirror.scss @@ -0,0 +1,91 @@ +.CodeMirror, +.CodeMirror.cm-s-default, +.CodeMirror.cm-s-paper { + .cm-property { + color: $text; + } + + .cm-header { + color: $text; + } + + .cm-quote { + color: $green; + } + + .cm-keyword { + color: $mauve; + } + + .cm-atom { + color: $red; + } + + .cm-number { + color: $peach; + } + + .cm-def { + color: $text; + } + + .cm-variable-2 { + color: $sky; + } + + .cm-variable-3 { + color: $teal; + } + + .cm-comment { + color: $surface2; + } + + .cm-string { + color: $green; + } + + .cm-string-2 { + color: $green; + } + + .cm-meta { + color: $peach; + } + + .cm-qualifier { + color: $peach; + } + + .cm-builtin { + color: $peach; + } + + .cm-bracket { + color: $text; + } + + .cm-tag { + color: $yellow; + } + + .cm-attribute { + color: $yellow; + } + + .cm-hr { + color: $overlay2; + } + + .cm-url { + color: $blue; + } + + .cm-link { + color: $blue; + } + + .cm-error { + color: $red; + } +} diff --git a/src/_theme.scss b/src/_theme.scss new file mode 100644 index 0000000..326aa15 --- /dev/null +++ b/src/_theme.scss @@ -0,0 +1,288 @@ +@use "sass:color"; + +// context-aware lighten: darkens if dark, lightens if light +@function ctx_lighten($color, $amount) { + $multiplier: if($isDark, -1, 1); + @return color.adjust($color, $lightness: $amount * $multiplier); +} + +$lvl1: if($isDark, $crust, $base); +$lvl2: $mantle; +$lvl3: if($isDark, $base, $crust); + +:root { + @if $isDark { + color-scheme: dark; + --is-dark-theme: true; + } @else { + color-scheme: light; + --is-dark-theme: false; + } + + accent-color: #{$accent}; + + --color-primary: #{$accent}; + --color-primary-contrast: #{$lvl1}; + + --color-primary-dark-1: #{ctx_lighten($accent, 3%)}; + --color-primary-dark-2: #{ctx_lighten($accent, 6%)}; + --color-primary-dark-3: #{ctx_lighten($accent, 9%)}; + --color-primary-dark-4: #{ctx_lighten($accent, 12%)}; + --color-primary-dark-5: #{ctx_lighten($accent, 15%)}; + --color-primary-dark-6: #{ctx_lighten($accent, 18%)}; + --color-primary-dark-7: #{ctx_lighten($accent, 21%)}; + + --color-primary-light-1: #{ctx_lighten($accent, -3%)}; + --color-primary-light-2: #{ctx_lighten($accent, -6%)}; + --color-primary-light-3: #{ctx_lighten($accent, -9%)}; + --color-primary-light-4: #{ctx_lighten($accent, -12%)}; + --color-primary-light-5: #{ctx_lighten($accent, -15%)}; + --color-primary-light-6: #{ctx_lighten($accent, -18%)}; + --color-primary-light-7: #{ctx_lighten($accent, -21%)}; + + --color-primary-alpha-10: #{color.change($accent, $alpha: 0.1)}; + --color-primary-alpha-20: #{color.change($accent, $alpha: 0.2)}; + --color-primary-alpha-30: #{color.change($accent, $alpha: 0.3)}; + --color-primary-alpha-40: #{color.change($accent, $alpha: 0.4)}; + --color-primary-alpha-50: #{color.change($accent, $alpha: 0.5)}; + --color-primary-alpha-60: #{color.change($accent, $alpha: 0.6)}; + --color-primary-alpha-70: #{color.change($accent, $alpha: 0.7)}; + --color-primary-alpha-80: #{color.change($accent, $alpha: 0.8)}; + --color-primary-alpha-90: #{color.change($accent, $alpha: 0.9)}; + + --color-secondary: #{$surface1}; + + --color-secondary-dark-1: #{ctx_lighten($surface0, -3%)}; + --color-secondary-dark-2: #{ctx_lighten($surface0, -6%)}; + --color-secondary-dark-3: #{ctx_lighten($surface0, -9%)}; + --color-secondary-dark-4: #{ctx_lighten($surface0, -12%)}; + --color-secondary-dark-5: #{ctx_lighten($surface0, -15%)}; + --color-secondary-dark-6: #{ctx_lighten($surface0, -18%)}; + --color-secondary-dark-7: #{ctx_lighten($surface0, -21%)}; + --color-secondary-dark-8: #{ctx_lighten($surface0, -24%)}; + --color-secondary-dark-9: #{ctx_lighten($surface0, -27%)}; + --color-secondary-dark-10: #{ctx_lighten($surface0, -30%)}; + --color-secondary-dark-11: #{ctx_lighten($surface0, -33%)}; + --color-secondary-dark-12: #{ctx_lighten($surface0, -36%)}; + --color-secondary-dark-13: #{ctx_lighten($surface0, -39%)}; + + --color-secondary-light-1: #{ctx_lighten($surface0, 3%)}; + --color-secondary-light-2: #{ctx_lighten($surface0, 6%)}; + --color-secondary-light-3: #{ctx_lighten($surface0, 9%)}; + --color-secondary-light-4: #{ctx_lighten($surface0, 12%)}; + + --color-secondary-alpha-10: #{color.change($surface0, $alpha: 0.1)}; + --color-secondary-alpha-20: #{color.change($surface0, $alpha: 0.2)}; + --color-secondary-alpha-30: #{color.change($surface0, $alpha: 0.3)}; + --color-secondary-alpha-40: #{color.change($surface0, $alpha: 0.4)}; + --color-secondary-alpha-50: #{color.change($surface0, $alpha: 0.5)}; + --color-secondary-alpha-60: #{color.change($surface0, $alpha: 0.6)}; + --color-secondary-alpha-70: #{color.change($surface0, $alpha: 0.7)}; + --color-secondary-alpha-80: #{color.change($surface0, $alpha: 0.8)}; + --color-secondary-alpha-90: #{color.change($surface0, $alpha: 0.9)}; + + /* colors */ + --color-red: #{$red}; + --color-orange: #{$peach}; + --color-yellow: #{$yellow}; + --color-olive: #{$green}; + --color-green: #{$green}; + --color-teal: #{$teal}; + --color-blue: #{$blue}; + --color-violet: #{$lavender}; + --color-purple: #{$mauve}; + --color-pink: #{$pink}; + --color-brown: #{$flamingo}; + --color-grey: #{$overlay2}; + --color-black: #{if(isDark, $mantle, $text)}; + + /* light variants - produced via Sass scale-color(color, $lightness: -10%) */ + --color-red-light: #{ctx_lighten($red, 10%)}; + --color-orange-light: #{ctx_lighten($peach, 10%)}; + --color-yellow-light: #{ctx_lighten($yellow, 10%)}; + --color-olive-light: #{ctx_lighten($green, 10%)}; + --color-green-light: #{ctx_lighten($green, 10%)}; + --color-teal-light: #{ctx_lighten($teal, 10%)}; + --color-blue-light: #{ctx_lighten($blue, 10%)}; + --color-violet-light: #{ctx_lighten($lavender, 10%)}; + --color-purple-light: #{ctx_lighten($mauve, 10%)}; + --color-pink-light: #{ctx_lighten($pink, 10%)}; + --color-brown-light: #{ctx_lighten($flamingo, 10%)}; + --color-grey-light: #{ctx_lighten($overlay2, 10%)}; + --color-black-light: #{if( + isDark, + ctx_lighten($mantle, 10%), + ctx_lighten($text, 10%) + )}; + + /* other colors */ + --color-gold: #{$rosewater}; + --color-white: #{$text}; + --color-diff-removed-word-bg: #{color.change($red, $alpha: 0.15)}; + --color-diff-added-word-bg: #{color.change($green, $alpha: 0.15)}; + --color-diff-removed-row-bg: #{color.change($red, $alpha: 0.07)}; + --color-diff-moved-row-bg: #{color.change($yellow, $alpha: 0.07)}; + --color-diff-added-row-bg: #{color.change($green, $alpha: 0.07)}; + --color-diff-removed-row-border: #{color.change($red, $alpha: 0.07)}; + --color-diff-moved-row-border: #{color.change($yellow, $alpha: 0.07)}; + --color-diff-added-row-border: #{color.change($green, $alpha: 0.07)}; + --color-diff-inactive: #{$overlay2}; + --color-error-border: #{$red}; + --color-error-bg: #{$red}; + --color-error-bg-active: #{ctx_lighten($red, 5%)}; + --color-error-bg-hover: #{ctx_lighten($red, 10%)}; + --color-error-text: #{$lvl1}; + --color-success-border: #{ctx_lighten($green, 10%)}; + --color-success-bg: #{$green}; + --color-success-text: #{$lvl1}; + --color-warning-border: #{ctx_lighten($yellow, 10%)}; + --color-warning-bg: #{$yellow}; + --color-warning-text: #{$lvl1}; + --color-info-border: #{ctx_lighten($blue, 10%)}; + --color-info-bg: #{$lvl1}; + --color-info-text: #{$text}; + --color-red-badge: #{ctx_lighten($red, 10%)}; + --color-red-badge-bg: #{$lvl1}; + --color-red-badge-hover-bg: #{ctx_lighten($red, 5%)}; + --color-green-badge: #{$green}; + --color-green-badge-bg: #{$lvl1}; + --color-green-badge-hover-bg: #{ctx_lighten($green, 5%)}; + --color-yellow-badge: #{$yellow}; + --color-yellow-badge-bg: #{$lvl1}; + --color-yellow-badge-hover-bg: #{ctx_lighten($yellow, 5%)}; + --color-orange-badge: #{$peach}; + --color-orange-badge-bg: #{$lvl1}; + --color-orange-badge-hover-bg: #{ctx_lighten($peach, 5%)}; + --color-git: #{$peach}; + + /* target-based colors */ + --color-body: #{$lvl1}; + --color-box-header: #{$lvl2}; + --color-box-body: #{$lvl2}; + --color-box-body-highlight: #{$surface0}; + --color-text-dark: #{$subtext0}; + --color-text: #{$text}; + --color-label-text: #{$text}; + --color-text-light: #{$subtext1}; + --color-text-light-1: #{$subtext1}; + --color-text-light-2: #{$subtext1}; + --color-text-light-3: #{$subtext1}; + --color-footer: #{$lvl2}; + --color-timeline: #{$surface0}; + --color-input-text: #{$text}; + --color-input-background: #{$surface0}; + --color-input-toggle-background: #{$surface0}; + --color-input-border: #{$surface1}; + --color-input-border-hover: #{$surface2}; + --color-header-wrapper: #{$lvl2}; + --color-header-wrapper-transparent: #{color.change($lvl1, $alpha: 0)}; + --color-light: #{color.change($surface2, $alpha: 0.3)}; + --color-label-bg: #{color.change($surface2, $alpha: 0.3)}; + --color-label-hover-bg: #{color.change($surface2, $alpha: 0.3)}; + --color-light-mimic-enabled: rgba( + 0, + 0, + 0, + calc(40 / 255 * 222 / 255 / var(--opacity-disabled)) + ); + --color-light-border: #{$surface2}; + --color-hover: #{color.change($overlay0, $alpha: 0.1)}; + --color-active: #{color.change($text, $alpha: 0.1)}; + --color-menu: #{$surface0}; + --color-card: #{$surface0}; + --color-markup-table-row: #{color.change($text, $alpha: 0.02)}; + --color-markup-code-block: #{color.change($text, $alpha: 0.05)}; + --color-button: #{$surface0}; + --color-code-bg: #{$base}; + --color-code-sidebar-bg: #{$surface0}; + --color-shadow: #{color.change($lvl1, $alpha: 0.1)}; + --color-secondary-bg: #{$surface0}; + --color-text-focus: #{$text}; + --color-expand-button: #{$surface2}; + --color-placeholder-text: #{$surface2}; + --color-editor-line-highlight: var(--color-primary-light-5); + --color-project-board-bg: var(--color-secondary-light-2); + /* gitea source code: */ + /* should ideally be --color-text-dark, see go-gitea/gitea#15651 */ + --color-caret: var(--color-text); + --color-reaction-bg: #{color.change($text, $alpha: 0.07)}; + --color-reaction-active-bg: var(--color-primary-alpha-40); + --color-nav-bg: #{$lvl2}; + --color-nav-hover-bg: #{$surface0}; + --color-label-active-bg: #{$surface2}; + --color-accent: var(--color-primary-light-1); + --color-small-accent: var(--color-primary-light-5); + --color-active-line: #{$surface1}; +} + +@if $isDark { + /* 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); + } +} + +.ui.ui.ui.button:not(.inverted, .basic), +.ui.ui.ui.label:not(.inverted, .basic) { + &.primary, + &.green, + &.red, + &.teal { + color: $lvl1; + &:hover { + color: $lvl3; + } + } +} + +.ui.basic.modal { + background-color: $lvl3; +} + +// link color for signed commits +.ui.commit-header-row .svg.gitea-lock ~ a { + color: $lvl1; +} + +// most recent commit hover when signed +.ui.sha.isSigned.isVerified:hover { + .shortsha { + color: $lvl1; + } + svg.gitea-lock { + fill: $lvl1; + } +} + +// modal text color for the "Remove GPG Key" modal +.ui.basic.modal, +.ui.basic.modal > .header, +.ui.inverted.button { + color: $text !important; +} + +::selection { + background: color.change($rosewater, $alpha: 0.3) !important; +} + +@import "chroma"; +@import "codemirror";