fix: broken checkbox default parsing

This commit is contained in:
Lewis Crichton 2024-01-14 16:11:26 +00:00
parent e350883b72
commit 3cf60f8daa
No known key found for this signature in database
2 changed files with 2 additions and 4 deletions

View file

@ -250,14 +250,12 @@ function ThemesTab() {
switch (varInfo.type) {
case "text":
case "color":
case "checkbox":
normalizedValue = varInfo.default;
break;
case "select":
normalizedValue = varInfo.options.find(v => v.name === varInfo.default)!.value;
break;
case "checkbox":
normalizedValue = varInfo.default ? "1" : "0";
break;
case "range":
normalizedValue = `${varInfo.default}${varInfo.units}`;
break;

View file

@ -19,7 +19,7 @@ declare module "usercss-meta" {
}
| {
type: "checkbox";
default: boolean;
default: string;
}
| {
type: "range";