Skip to content

Build your personal knowledge base with Trilium Notes

style(client): move the input-group buttons' rules to their components

Elian Doran9f6153dc7f69
diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css
index c52c38a85d..e73054a6fc 100644
--- a/apps/client/src/stylesheets/style.css
+++ b/apps/client/src/stylesheets/style.css
@@ -775,23 +775,6 @@ pre > button.copy-button:active {
cursor: pointer;
}
-.input-clearer-button {
- cursor: pointer;
- font-size: 1.3em;
- background: inherit !important;
- padding-top: 8px;
- padding-inline-start: 5px;
- padding-inline-end: 5px;
-}
-
-.open-external-link-button {
- cursor: pointer;
- font-size: 1.3em;
- padding-inline-start: 5px;
- padding-inline-end: 5px;
- padding-top: 8px;
-}
-
table.promoted-attributes-in-tooltip {
margin: auto;
}
diff --git a/apps/client/src/widgets/attribute_widgets/label_value_input.css b/apps/client/src/widgets/attribute_widgets/label_value_input.css
index f8597546f4..732aeff03d 100644
--- a/apps/client/src/widgets/attribute_widgets/label_value_input.css
+++ b/apps/client/src/widgets/attribute_widgets/label_value_input.css
@@ -99,3 +99,15 @@ body[dir=rtl] .label-select-combobox.form-control:focus {
.input-group:has(> .label-color-picker) {
width: fit-content;
}
+
+/* One class, so the next theme's `.input-group .input-group-text` overrides it. */
+.open-external-link-button {
+ cursor: pointer;
+}
+
+/* Outranks Bootstrap's `.input-group-text`. */
+.input-group-text.open-external-link-button {
+ font-size: 1.3em;
+ padding-top: 8px;
+ padding-inline: 5px;
+}
diff --git a/apps/client/src/widgets/react/NoteAutocomplete.css b/apps/client/src/widgets/react/NoteAutocomplete.css
index b699b59220..a3f1428c4b 100644
--- a/apps/client/src/widgets/react/NoteAutocomplete.css
+++ b/apps/client/src/widgets/react/NoteAutocomplete.css
@@ -1,8 +1,7 @@
/*
- * Unlike `style.css`, which loads after Bootstrap and the theme, this file has no fixed place among
- * them. Each selector carries one more class or element than the rule it competes with (Bootstrap's
- * `.input-group-text` and `.form-control`, the `.aa-suggestion` rules in the next theme's
- * `base.css`), so the outcome does not depend on the order.
+ * This file has no fixed place in the load order against Bootstrap and the theme, so specificity
+ * settles each conflict: a rule that must win carries a class more than its rival, and a rule the
+ * next theme overrides keeps to one class.
*/
.input-group > .note-autocomplete-input {
@@ -10,13 +9,23 @@
border-inline-end: 0;
}
-.input-group > :is(.show-recent-notes-button, .full-text-search-button, .go-to-selected-note-button) {
+/* One class, so the next theme's input-group rules override these. */
+:is(.show-recent-notes-button, .full-text-search-button, .go-to-selected-note-button, .input-clearer-button) {
cursor: pointer;
+}
+
+.input-clearer-button {
+ background: inherit !important;
+}
+
+.input-group > :is(.show-recent-notes-button, .full-text-search-button, .go-to-selected-note-button),
+.note-autocomplete ~ .input-clearer-button {
font-size: 1.3em;
padding-inline: 5px;
}
-.input-group > :is(.show-recent-notes-button, .go-to-selected-note-button) {
+.input-group > :is(.show-recent-notes-button, .go-to-selected-note-button),
+.note-autocomplete ~ .input-clearer-button {
padding-top: 8px;
}
@@ -37,7 +46,6 @@
}
.algolia-autocomplete .aa-dropdown-menu {
- /* `autocomplete.js` set it inline. */
display: block;
width: 100%;
background-color: var(--main-background-color);
@@ -49,7 +57,6 @@
margin: 0;
}
-/* `autocomplete.js` set it inline. */
.algolia-autocomplete .aa-suggestions {
display: block;
}
@@ -58,7 +65,6 @@ span.aa-dropdown-menu .aa-suggestion {
cursor: pointer;
padding: 6px 16px;
margin: 0;
- /* `autocomplete.js` set these inline. */
white-space: nowrap;
> * {
diff --git a/apps/client/src/widgets/type_widgets/options/active_content.css b/apps/client/src/widgets/type_widgets/options/active_content.css
index d4f73e7ea7..ee03f232cd 100644
--- a/apps/client/src/widgets/type_widgets/options/active_content.css
+++ b/apps/client/src/widgets/type_widgets/options/active_content.css
@@ -138,3 +138,16 @@ body.mobile {
letter-spacing: normal;
text-transform: none;
}
+
+/* One class, so the next theme's input-group rules override these. */
+.input-clearer-button {
+ cursor: pointer;
+ background: inherit !important;
+}
+
+/* Outranks Bootstrap's `.input-group-text`. */
+.active-content-filter > .input-clearer-button {
+ font-size: 1.3em;
+ padding-top: 8px;
+ padding-inline: 5px;
+}