Skip to content

Build your personal knowledge base with Trilium Notes

chore(next): improve performance of a specific selector

Elian Doran2fac2a8c5e25
diff --git a/apps/client/src/stylesheets/theme-next/shell.css b/apps/client/src/stylesheets/theme-next/shell.css
index 2dfdadfbc5..d014e770bb 100644
--- a/apps/client/src/stylesheets/theme-next/shell.css
+++ b/apps/client/src/stylesheets/theme-next/shell.css
@@ -1301,9 +1301,9 @@ div.promoted-attribute-cell .tn-checkbox {
height: 1cap;
}
-/* The <div> containing the checkbox for a promoted boolean attribute */
-div.promoted-attribute-cell div:has(input[type="checkbox"]) {
- order: -1; /* Relocate the checkbox before the label */
+/* Relocate the checkbox before the label */
+div.promoted-attribute-cell.promoted-attribute-label-boolean > div:first-of-type {
+ order: -1;
margin-right: 1.5em;
}
diff --git a/apps/client/src/widgets/ribbon_widgets/promoted_attributes.ts b/apps/client/src/widgets/ribbon_widgets/promoted_attributes.ts
index 33341dd3fa..a9aef77db0 100644
--- a/apps/client/src/widgets/ribbon_widgets/promoted_attributes.ts
+++ b/apps/client/src/widgets/ribbon_widgets/promoted_attributes.ts
@@ -188,6 +188,7 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
.append($multiplicityCell);
if (valueAttr.type === "label") {
+ $wrapper.addClass(`promoted-attribute-label-${definition.labelType}`);
if (definition.labelType === "text") {
$input.prop("type", "text");