@gtk-js/theme-whitesur 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/build.ts +112 -0
- package/dist/dark_default.css +8992 -0
- package/dist/index.ts +2 -0
- package/dist/light_default.css +9021 -0
- package/package.json +19 -0
- package/src/index.ts +20 -0
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gtk-js/theme-whitesur",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.0.2",
|
|
7
|
+
"main": "src/index.ts",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@gtk-js/gtk-css": "0.1.1",
|
|
10
|
+
"fast-xml-parser": "^5.5.10"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./src/index.ts"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "bun build.ts"
|
|
17
|
+
},
|
|
18
|
+
"type": "module"
|
|
19
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GtkTheme, resolveColorScheme } from "@gtk-js/gtk-css";
|
|
2
|
+
import dark from "../dist/dark_default.css" with { type: "text" };
|
|
3
|
+
import light from "../dist/light_default.css" with { type: "text" };
|
|
4
|
+
|
|
5
|
+
export class WhiteSurTheme extends GtkTheme {
|
|
6
|
+
readonly colorScheme: "light" | "dark" | "auto";
|
|
7
|
+
|
|
8
|
+
constructor({
|
|
9
|
+
colorScheme = "light",
|
|
10
|
+
}: {
|
|
11
|
+
colorScheme?: "light" | "dark" | "auto";
|
|
12
|
+
} = {}) {
|
|
13
|
+
super();
|
|
14
|
+
this.colorScheme = colorScheme;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getCSS() {
|
|
18
|
+
return resolveColorScheme(this.colorScheme) === "dark" ? dark : light;
|
|
19
|
+
}
|
|
20
|
+
}
|