File tree 5 files changed +50
-1
lines changed
keybr-theme-designer/lib/design
5 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1
- import { Box } from "@keybr/widget" ;
1
+ import { images } from "@keybr/themes" ;
2
+ import { Box , Button , Para } from "@keybr/widget" ;
2
3
import { useCustomTheme } from "./context.ts" ;
3
4
import { Group } from "./Group.tsx" ;
4
5
import { ImageInput } from "./input/ImageInput.tsx" ;
@@ -15,6 +16,33 @@ export function BackgroundImage() {
15
16
} }
16
17
/>
17
18
</ Box >
19
+ < Para align = "center" >
20
+ < Button
21
+ label = "Clear"
22
+ onClick = { ( ) => {
23
+ setTheme ( theme . delete ( "--background-image" ) ) ;
24
+ } }
25
+ />
26
+ { " or " }
27
+ < Button
28
+ label = "Chocolate"
29
+ onClick = { ( ) => {
30
+ setTheme ( theme . set ( "--background-image" , images . chocolate ) ) ;
31
+ } }
32
+ />
33
+ < Button
34
+ label = "Coffee"
35
+ onClick = { ( ) => {
36
+ setTheme ( theme . set ( "--background-image" , images . coffee ) ) ;
37
+ } }
38
+ />
39
+ < Button
40
+ label = "Garden"
41
+ onClick = { ( ) => {
42
+ setTheme ( theme . set ( "--background-image" , images . garden ) ) ;
43
+ } }
44
+ />
45
+ </ Para >
18
46
</ Group >
19
47
) ;
20
48
}
Original file line number Diff line number Diff line change
1
+ import chocolateSvg from "../../assets/bg-chocolate.svg" ;
2
+ import coffeeSvg from "../../assets/bg-coffee.svg" ;
3
+ import gardenSvg from "../../assets/bg-garden.svg" ;
4
+ import { UrlAsset } from "./asset.ts" ;
5
+
6
+ export const images = {
7
+ chocolate : new UrlAsset ( chocolateSvg ) ,
8
+ coffee : new UrlAsset ( coffeeSvg ) ,
9
+ garden : new UrlAsset ( gardenSvg ) ,
10
+ } as const ;
Original file line number Diff line number Diff line change
1
+ import { UrlAsset } from "./asset.ts" ;
2
+
3
+ export const images = {
4
+ chocolate : new UrlAsset ( "" ) ,
5
+ coffee : new UrlAsset ( "" ) ,
6
+ garden : new UrlAsset ( "" ) ,
7
+ } as const ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ export * from "./asset.ts";
2
2
export * from "./context.ts" ;
3
3
export * from "./custom-theme.ts" ;
4
4
export * from "./dynamic-styles-context.tsx" ;
5
+ export * from "./images.ts" ;
5
6
export * from "./prefs.ts" ;
6
7
export * from "./theme-io.ts" ;
7
8
export * from "./theme-props.ts" ;
Original file line number Diff line number Diff line change 6
6
"main" : " lib/index.ts" ,
7
7
"types" : " .types/index.d.ts" ,
8
8
"sideEffects" : false ,
9
+ "browser" : {
10
+ "./lib/themes/images.ts" : " ./lib/themes/images-browser.ts"
11
+ },
9
12
"dependencies" : {
10
13
"@keybr/color" : " *" ,
11
14
"@keybr/rand" : " *" ,
You can’t perform that action at this time.
0 commit comments