Skip to content

Commit ec21a6e

Browse files
committed
typescript, color changes
1 parent 4597149 commit ec21a6e

5 files changed

Lines changed: 78 additions & 33 deletions

File tree

index.d.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
export interface Theme {
2+
$schema?: string;
3+
name: string;
4+
type: 'light' | 'dark';
5+
colors: Record<string, string>;
6+
semanticHighlighting?: boolean;
7+
semanticTokenColors?: Record<string, any>;
8+
tokenColors: Array<{
9+
name?: string;
10+
scope?: string | string[];
11+
settings: {
12+
foreground?: string;
13+
background?: string;
14+
fontStyle?: string;
15+
};
16+
}>;
17+
// Shiki compatibility
18+
settings?: Array<{
19+
settings: {
20+
foreground?: string;
21+
background?: string;
22+
};
23+
}>;
24+
}
25+
26+
export const bootstrapLight: Theme;
27+
export const bootstrapDark: Theme;
28+
export const bootstrapLightVibrant: Theme;
29+
export const bootstrapDarkVibrant: Theme;
30+
31+
export const themes: {
32+
light: Theme;
33+
dark: Theme;
34+
lightVibrant: Theme;
35+
darkVibrant: Theme;
36+
};

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
export { default as bootstrapLight } from './themes/bootstrap-light.json' with { type: 'json' };
2-
export { default as bootstrapDark } from './themes/bootstrap-dark.json' with { type: 'json' };
3-
export { default as bootstrapLightVibrant } from './themes/bootstrap-light-vibrant.json' with { type: 'json' };
4-
export { default as bootstrapDarkVibrant } from './themes/bootstrap-dark-vibrant.json' with { type: 'json' };
1+
import bootstrapLight from './themes/bootstrap-light.json' with { type: 'json' };
2+
import bootstrapDark from './themes/bootstrap-dark.json' with { type: 'json' };
3+
import bootstrapLightVibrant from './themes/bootstrap-light-vibrant.json' with { type: 'json' };
4+
import bootstrapDarkVibrant from './themes/bootstrap-dark-vibrant.json' with { type: 'json' };
5+
6+
export { bootstrapLight, bootstrapDark, bootstrapLightVibrant, bootstrapDarkVibrant };
57

68
export const themes = {
79
light: bootstrapLight,

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "bootstrap-vscode-theme",
33
"displayName": "Bootstrap Theme",
44
"description": "Bootstrap theme for Shiki, VS Code, and more",
5-
"version": "0.0.9",
5+
"version": "0.0.10",
66
"publisher": "bootstrap",
77
"icon": "icon.png",
88
"galleryBanner": {
@@ -62,12 +62,17 @@
6262
"prepublishOnly": "npm run build"
6363
},
6464
"type": "module",
65+
"types": "./index.d.ts",
6566
"exports": {
66-
".": "./index.js",
67+
".": {
68+
"types": "./index.d.ts",
69+
"import": "./index.js"
70+
},
6771
"./themes/*.json": "./themes/*.json"
6872
},
6973
"files": [
7074
"index.js",
75+
"index.d.ts",
7176
"themes/",
7277
"icon.png",
7378
"README.md",

src/palette.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -290,24 +290,24 @@ export const light: Roles = {
290290
},
291291
syntax: {
292292
comment: gray["600"],
293-
string: green["600"],
294-
number: cyan["600"],
295-
keyword: pink["500"],
293+
string: green["600"], // Green for strings
294+
number: blue["600"], // Blue for numbers
295+
keyword: purple["600"], // Purple for keywords (import, export, const, etc.)
296296
regexp: teal["600"],
297-
func: indigo["500"],
298-
type: violet["500"],
299-
variable: orange["600"],
297+
func: blue["600"], // Blue for functions
298+
type: cyan["700"], // Cyan/teal for types
299+
variable: gray["800"], // Darker gray for variables (more neutral)
300300
// Extended token types
301-
operator: cyan["500"],
301+
operator: purple["600"], // Purple for operators
302302
punctuation: gray["700"],
303-
constant: yellow["600"],
304-
parameter: gray["700"],
305-
namespace: yellow["600"],
306-
decorator: blue["500"],
303+
constant: blue["600"], // Blue for constants
304+
parameter: gray["800"], // Darker gray for parameters
305+
namespace: cyan["700"], // Cyan for namespaces
306+
decorator: purple["600"], // Purple for decorators
307307
escape: cyan["600"],
308308
invalid: red["500"],
309-
tag: red["600"],
310-
attribute: teal["600"]
309+
tag: pink["600"], // Pink for HTML tags
310+
attribute: cyan["700"] // Cyan for attributes
311311
},
312312
ansi: {
313313
black: gray["980"],
@@ -367,24 +367,24 @@ export const dark: Roles = {
367367
},
368368
syntax: {
369369
comment: gray["600"],
370-
string: green["400"],
371-
number: cyan["400"],
372-
keyword: pink["400"],
370+
string: indigo["300"], // Indigo for strings/attribute values (like "button", "btn")
371+
number: cyan["400"], // Cyan for numbers
372+
keyword: purple["400"], // Purple for keywords (like @include, var, rgba)
373373
regexp: teal["400"],
374-
func: indigo["400"],
375-
type: violet["400"],
376-
variable: orange["400"],
374+
func: cyan["400"], // Cyan for functions
375+
type: teal["400"], // Teal for types
376+
variable: cyan["300"], // Light cyan for variables
377377
// Extended token types
378-
operator: cyan["500"],
379-
punctuation: gray["700"],
380-
constant: yellow["400"],
381-
parameter: gray["400"],
382-
namespace: yellow["500"],
383-
decorator: blue["400"],
378+
operator: purple["400"], // Purple for operators
379+
punctuation: gray["400"], // Lighter punctuation
380+
constant: cyan["400"], // Cyan for constants
381+
parameter: cyan["300"], // Light cyan for parameters
382+
namespace: teal["400"], // Teal for namespaces
383+
decorator: purple["400"], // Purple for decorators
384384
escape: cyan["400"],
385385
invalid: red["400"],
386-
tag: red["400"],
387-
attribute: teal["400"]
386+
tag: cyan["400"], // Cyan for HTML tags (like <button>)
387+
attribute: teal["400"] // Teal for attributes (like type, class, disabled)
388388
},
389389
ansi: {
390390
black: gray["1000"],

src/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ export function makeTheme(name: string, kind: "light"|"dark", c: Roles): VSCodeT
146146
// ========================================
147147
{ scope: ["comment","punctuation.definition.comment"], settings: { foreground: c.syntax.comment } },
148148
{ scope: "comment markup.link", settings: { foreground: c.syntax.comment } },
149+
{ scope: "comment.line.double-slash", settings: { foreground: c.syntax.comment } },
150+
{ scope: ["comment.line.scss","comment.block.scss","comment.line.css","comment.block.css"], settings: { foreground: c.syntax.comment } },
149151

150152
// ========================================
151153
// STRINGS

0 commit comments

Comments
 (0)