diff --git a/scripts/verify-generated-theme.ts b/scripts/verify-generated-theme.ts index 1a7e8f6..feed6f4 100644 --- a/scripts/verify-generated-theme.ts +++ b/scripts/verify-generated-theme.ts @@ -30,6 +30,8 @@ const requiredDarkSnippets = [ "--is-dark-theme: true", "--color-body: #0d1117", "--color-text: #e6edf3", + "--color-diff-added-row-bg: #033a16", + "--color-diff-removed-row-bg: #490202", "--github-bgColor-accent-emphasis: #1f6feb", "--color-syntax-keyword: #ff7b72", "--color-syntax-string: #a5d6ff", @@ -74,7 +76,15 @@ for (const file of [ } } -for (const file of ["theme-meta.ts", "core.ts", "github-colors.ts", "syntax-colors.ts", "target-colors.ts", "index.ts"]) { +for (const file of [ + "theme-meta.ts", + "core.ts", + "diff-colors.ts", + "github-colors.ts", + "syntax-colors.ts", + "target-colors.ts", + "index.ts", +]) { if (!darkThemeFiles.includes(file)) { throw new Error(`themes/github-dark is missing theme source file: ${file}`); } diff --git a/themes/github-dark/diff-colors.ts b/themes/github-dark/diff-colors.ts new file mode 100644 index 0000000..8fbe945 --- /dev/null +++ b/themes/github-dark/diff-colors.ts @@ -0,0 +1,15 @@ +export const diffColorTokens = ` +--color-diff-added-fg: #3fb950; + --color-diff-added-linenum-bg: #0e4429; + --color-diff-added-row-bg: #033a16; + --color-diff-added-row-border: #196c2e; + --color-diff-added-word-bg: #196c2e; + --color-diff-removed-fg: #ff7b72; + --color-diff-removed-linenum-bg: #67060c; + --color-diff-removed-row-bg: #490202; + --color-diff-removed-row-border: #7d121c; + --color-diff-removed-word-bg: #7d121c; + --color-diff-moved-row-bg: #3d2f00; + --color-diff-moved-row-border: #9e6a03; + --color-diff-inactive: #161b22; +`.trim(); diff --git a/themes/github-dark/index.ts b/themes/github-dark/index.ts index a58e5f0..6552dff 100644 --- a/themes/github-dark/index.ts +++ b/themes/github-dark/index.ts @@ -1,9 +1,9 @@ import { ansiColorTokens } from "../github-light/ansi-colors"; -import { diffColorTokens } from "../github-light/diff-colors"; import { namedColorTokens } from "../github-light/named-colors"; import { semanticColorTokens } from "../github-light/semantic-colors"; import { consoleTokens } from "./console"; import { coreTokens } from "./core"; +import { diffColorTokens } from "./diff-colors"; import { githubColorTokens } from "./github-colors"; import { syntaxColorTokens } from "./syntax-colors"; import { targetColorTokens } from "./target-colors"; diff --git a/themes/github-dark/syntax-colors.ts b/themes/github-dark/syntax-colors.ts index d2a936e..0efe268 100644 --- a/themes/github-dark/syntax-colors.ts +++ b/themes/github-dark/syntax-colors.ts @@ -29,8 +29,8 @@ export const syntaxColorTokens = ` --color-syntax-punctuation: var(--color-text); --color-syntax-whitespace: #f85149; --color-syntax-diff-fg: var(--color-text); - --color-syntax-deleted-bg: #67060c; - --color-syntax-inserted-bg: #033a16; + --color-syntax-deleted-bg: var(--color-diff-removed-row-bg); + --color-syntax-inserted-bg: var(--color-diff-added-row-bg); --color-syntax-emph: var(--color-text); --color-syntax-strong: var(--color-text); --color-syntax-heading: #1f6feb;