Skip to content

Build your personal knowledge base with Trilium Notes

fix(attributes): keep the add button from deciding a chip field's height

Elian Doran38bd1e50706f
diff --git a/apps/client/src/widgets/attribute_widgets/values_input.css b/apps/client/src/widgets/attribute_widgets/values_input.css
index 6c91b98f1a..2b4ebd6a54 100644
--- a/apps/client/src/widgets/attribute_widgets/values_input.css
+++ b/apps/client/src/widgets/attribute_widgets/values_input.css
@@ -1,3 +1,31 @@
+/*
+ * The button asking for what the box holds. It comes and goes with there being something to take, so
+ * it must not be what decides how tall the field is: left at the size an icon button is given
+ * everywhere else, it stands taller than the line the chips and the box make, and the field — as
+ * tall as the tallest thing in it — would grow the moment anything is typed and shrink again on
+ * taking it. Sized to the button a chip is removed by, which the field already sits around, so it
+ * both keeps its place and reads as one of the pair.
+ *
+ * Only the mind map's node panel shows the growth: the promoted-attribute row and the table's
+ * editor each give the field a height to sit against, which swallows it.
+ */
+.values-input .values-input-add {
+ --values-input-add-size: 20px;
+ /* Read by the themes that size an icon button through it; the rest is for those that don't. */
+ --icon-button-size: var(--values-input-add-size);
+ --icon-button-icon-ratio: 0.9;
+
+ flex-shrink: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: var(--values-input-add-size);
+ height: var(--values-input-add-size);
+ padding: 0;
+ font-size: calc(var(--values-input-add-size) * 0.9);
+ line-height: 1;
+}
+
/*
* The picker at the end of a field of colours. A colour is chosen rather than typed, so it asks for
* no room to type in: it sits at its own size beside the chips instead of taking the line a text box