@@ -46,22 +46,14 @@ It's recommended to initialize Palettez in a synchronous script to avoid theme f
46
46
;(async () => {
47
47
const themeStore = window .palettez .createThemeStore ({
48
48
config: {
49
- colorScheme: {
50
- label: ' Color scheme' ,
51
- options: {
52
- system: {
53
- value: ' System' ,
54
- isDefault: true ,
55
- media: {
56
- query: ' (prefers-color-scheme: dark)' ,
57
- ifMatch: ' dark' ,
58
- ifNotMatch: ' light' ,
59
- },
60
- },
61
- light: { value: ' Light' },
62
- dark: { value: ' Dark' },
49
+ colorScheme: [
50
+ {
51
+ value: ' system' ,
52
+ media: [' (prefers-color-scheme: dark)' , ' dark' , ' light' ],
63
53
},
64
- },
54
+ ' light' ,
55
+ ' dark' ,
56
+ ],
65
57
},
66
58
})
67
59
@@ -101,41 +93,26 @@ const themeStore = createThemeStore({
101
93
102
94
// required, specify theme and options
103
95
config: {
104
- colorScheme: {
105
- label: ' Color scheme' ,
106
- options: {
107
- system: {
108
- value: ' System' ,
109
- isDefault: true ,
110
-
111
- // only supported client-side
112
- media: {
113
- query: ' (prefers-color-scheme: dark)' ,
114
- ifMatch: ' dark' ,
115
- ifNotMatch: ' light' ,
116
- },
117
- },
118
- light: { value: ' Light' },
119
- dark: { value: ' Dark' },
96
+ colorScheme: [
97
+ {
98
+ value: ' system' ,
99
+ media: [' (prefers-color-scheme: dark)' , ' dark' , ' light' ],
120
100
},
121
- },
122
-
123
- contrast: {
124
- label: ' Contrast' ,
125
- options: {
126
- system: {
127
- value: ' System' ,
128
- isDefault: true ,
129
- media: {
130
- query: ' (prefers-contrast: more) and (forced-colors: none)' ,
131
- ifMatch: ' more' ,
132
- ifNotMatch: ' standard' ,
133
- },
134
- },
135
- standard: { value: ' Standard' },
136
- high: { value: ' High' },
101
+ ' light' ,
102
+ ' dark' ,
103
+ ],
104
+ contrast: [
105
+ {
106
+ value: ' system' ,
107
+ media: [
108
+ ' (prefers-contrast: more) and (forced-colors: none)' ,
109
+ ' high' ,
110
+ ' standard' ,
111
+ ],
137
112
},
138
- },
113
+ ' standard' ,
114
+ ' high' ,
115
+ ],
139
116
},
140
117
141
118
// optional, specify your own storage solution. localStorage is used by default.
0 commit comments