feat(promoted_attributes): add color type

This commit is contained in:
Elian Doran
2025-07-26 09:29:27 +03:00
parent 7d7c3e7cdb
commit b29781b614
5 changed files with 22 additions and 3 deletions

View File

@@ -66,6 +66,12 @@ const TPL = /*html*/`
appearance: auto;
}
.promoted-attribute-cell input[type="color"] {
width: 50px;
padding: 0;
border: 0;
}
</style>
<div class="promoted-attributes-container"></div>
@@ -265,6 +271,8 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
.on("click", () => window.open($input.val() as string, "_blank"));
$input.after($openButton);
} else if (definition.labelType === "color") {
$input.prop("type", "color");
} else {
ws.logError(t("promoted_attributes.unknown_label_type", { type: definition.labelType }));
}