Skip to content

Build your personal knowledge base with Trilium Notes

fix(forms): size number boxes with a unit under the legacy theme

Elian Doran02d9666fb71f
diff --git a/apps/client/src/stylesheets/theme-next/forms.css b/apps/client/src/stylesheets/theme-next/forms.css
index 1a8e120185..d0df405bd5 100644
--- a/apps/client/src/stylesheets/theme-next/forms.css
+++ b/apps/client/src/stylesheets/theme-next/forms.css
@@ -233,24 +233,6 @@ input::selection,
font-style: italic;
}
-/*
- Numeric input with measurement unit as a sufix
-
- <label class="input-group tn-number-unit-pair">
- <input ... >
- <span class="input-group-text">meters</span>
- </label>
-*/
-
-label.input-group.tn-number-unit-pair {
- width: fit-content;
-}
-
-label.input-group.tn-number-unit-pair input {
- width: 120px !important;
- padding-inline-end: 0;
-}
-
:root .input-group > pre[aria-hidden="true"] {
margin: 0;
padding: 0;
diff --git a/apps/client/src/widgets/react/FormTextBox.css b/apps/client/src/widgets/react/FormTextBox.css
new file mode 100644
index 0000000000..19ac0c22cb
--- /dev/null
+++ b/apps/client/src/widgets/react/FormTextBox.css
@@ -0,0 +1,9 @@
+/* A number with its unit as a suffix (`FormTextBoxWithUnit`). */
+label.input-group.tn-number-unit-pair {
+ width: fit-content;
+}
+
+label.input-group.tn-number-unit-pair input {
+ width: 120px !important;
+ padding-inline-end: 0;
+}
diff --git a/apps/client/src/widgets/react/FormTextBox.tsx b/apps/client/src/widgets/react/FormTextBox.tsx
index ffb2e6fb57..4148812bfc 100644
--- a/apps/client/src/widgets/react/FormTextBox.tsx
+++ b/apps/client/src/widgets/react/FormTextBox.tsx
@@ -1,3 +1,5 @@
+import "./FormTextBox.css";
+
import type { InputHTMLAttributes, LooseInputHTMLAttributes, RefObject } from "preact";
import { useEffect, useRef } from "preact/hooks";
diff --git a/apps/client/src/widgets/type_widgets/options/appearance_fonts.css b/apps/client/src/widgets/type_widgets/options/appearance_fonts.css
index 233ccb57d2..fe764f4836 100644
--- a/apps/client/src/widgets/type_widgets/options/appearance_fonts.css
+++ b/apps/client/src/widgets/type_widgets/options/appearance_fonts.css
@@ -167,7 +167,7 @@ body.mobile .modal.font-picker-modal {
flex: 1;
}
- /* The pair sizes itself (see `theme-next/forms.css`), so the slider takes what is left. */
+ /* The pair sizes itself (see FormTextBox.css), so the slider takes what is left. */
.tn-number-unit-pair {
flex: 0 0 auto;
}