Skip to content

Commit 06459bf

Browse files
committed
Add more colors
1 parent 0c906d2 commit 06459bf

File tree

6 files changed

+42
-1
lines changed

6 files changed

+42
-1
lines changed

.changeset/three-suns-smoke.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@code-hike/lighter": patch
3+
---
4+
5+
Add more colors

lib/dist/index.cjs.js

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/dist/index.d.ts

+12
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ declare function getThemeColors(theme: FinalTheme): {
5858
listSelectionForeground: string;
5959
listHoverBackground: string;
6060
listHoverForeground: string;
61+
tabsBorder: string;
62+
activeTabTopBorder: string;
63+
hoverTabBackground: string;
64+
hoverTabForeground: string;
6165
colorScheme: "dark" | "light";
6266
};
6367

@@ -143,6 +147,10 @@ declare function highlight(code: string, alias: LanguageAlias, themeOrThemeName?
143147
listSelectionForeground: string;
144148
listHoverBackground: string;
145149
listHoverForeground: string;
150+
tabsBorder: string;
151+
activeTabTopBorder: string;
152+
hoverTabBackground: string;
153+
hoverTabForeground: string;
146154
colorScheme: "dark" | "light";
147155
};
148156
}>;
@@ -178,6 +186,10 @@ declare function annotatedHighlight(code: string, alias: LanguageAlias, themeOrT
178186
listSelectionForeground: string;
179187
listHoverBackground: string;
180188
listHoverForeground: string;
189+
tabsBorder: string;
190+
activeTabTopBorder: string;
191+
hoverTabBackground: string;
192+
hoverTabForeground: string;
181193
colorScheme: "dark" | "light";
182194
};
183195
}>;

lib/dist/index.esm.mjs

+8
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ const colorNamesToKeys = {
467467
listSelectionForeground: "list.inactiveSelectionForeground",
468468
listHoverBackground: "list.hoverBackground",
469469
listHoverForeground: "list.hoverForeground",
470+
tabsBorder: "editorGroupHeader.tabsBorder",
471+
activeTabTopBorder: "tab.activeBorderTop",
472+
hoverTabBackground: "tab.hoverBackground",
473+
hoverTabForeground: "tab.hoverForeground",
470474
};
471475
function getColors(theme) {
472476
const colors = {};
@@ -568,6 +572,10 @@ const defaults = {
568572
"list.inactiveSelectionForeground": { dark: undefined, light: undefined },
569573
"list.hoverBackground": { dark: "#2A2D2E", light: "#F0F0F0" },
570574
"list.hoverForeground": { dark: undefined, light: undefined },
575+
"editorGroupHeader.tabsBorder": { hc: contrastBorder },
576+
"tab.activeBorderTop": { hc: contrastBorder },
577+
"tab.hoverBackground": "tab.inactiveBackground",
578+
"tab.hoverForeground": "tab.inactiveForeground",
571579
};
572580

573581
async function loadTheme(theme) {

lib/src/theme-colors.ts

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ const colorNamesToKeys = {
3535
listSelectionForeground: "list.inactiveSelectionForeground",
3636
listHoverBackground: "list.hoverBackground",
3737
listHoverForeground: "list.hoverForeground",
38+
tabsBorder: "editorGroupHeader.tabsBorder",
39+
activeTabTopBorder: "tab.activeBorderTop",
40+
hoverTabBackground: "tab.hoverBackground",
41+
hoverTabForeground: "tab.hoverForeground",
3842
};
3943

4044
function getColors(theme: FinalTheme) {
@@ -142,4 +146,8 @@ const defaults = {
142146
"list.inactiveSelectionForeground": { dark: undefined, light: undefined },
143147
"list.hoverBackground": { dark: "#2A2D2E", light: "#F0F0F0" },
144148
"list.hoverForeground": { dark: undefined, light: undefined },
149+
"editorGroupHeader.tabsBorder": { hc: contrastBorder },
150+
"tab.activeBorderTop": { hc: contrastBorder },
151+
"tab.hoverBackground": "tab.inactiveBackground",
152+
"tab.hoverForeground": "tab.inactiveForeground",
145153
};

test/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async function run() {
2121

2222
const result = await annotatedHighlight(newCode, alias, theme, annotations);
2323
// console.log(JSON.stringify(result.lines));
24-
console.log(JSON.stringify(result.lines, null, 1));
24+
console.log(JSON.stringify(result.colors, null, 1));
2525
}
2626

2727
run();

0 commit comments

Comments
 (0)