Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
style/options: add a shared style for thumbnail selector cards
Adorian Doran209a1eec7086
diff --git a/apps/client/src/widgets/type_widgets/options/appearance.css b/apps/client/src/widgets/type_widgets/options/appearance.cssindex ceacec262b..b2bc6b1df8 100644--- a/apps/client/src/widgets/type_widgets/options/appearance.css+++ b/apps/client/src/widgets/type_widgets/options/appearance.css@@ -6,11 +6,6 @@gap: 24px;> .tn-card {- /* More room above and below than a settings row needs: what these hold is a pair of- pictures, not a line of text — and nothing behind them, so the page shows through and the- illustrations read as the drawings they are rather than as a filled-in control. */- --card-padding-block: 12px;- --card-background-color: transparent;flex: 1 1 320px;}}diff --git a/apps/client/src/widgets/type_widgets/options/appearance.tsx b/apps/client/src/widgets/type_widgets/options/appearance.tsxindex 2bfdb30047..abba618664 100644--- a/apps/client/src/widgets/type_widgets/options/appearance.tsx+++ b/apps/client/src/widgets/type_widgets/options/appearance.tsx@@ -270,7 +270,7 @@ function LayoutStyle() {const [ newLayout, setNewLayout ] = useTriliumOptionBool("newLayout");return (- <Card heading={t("settings_appearance.ui_layout_style")}>+ <Card className="thumbnail-selector-option-card" heading={t("settings_appearance.ui_layout_style")}><CardSection><RadioWithIllustrationcurrentValue={newLayout ? "new-layout" : "old-layout"}@@ -292,7 +292,7 @@ function LayoutOrientation() {const [ layoutOrientation, setLayoutOrientation ] = useTriliumOption("layoutOrientation", true);return (- <Card heading={t("settings_appearance.ui_layout_orientation")}>+ <Card className="thumbnail-selector-option-card" heading={t("settings_appearance.ui_layout_orientation")}><CardSection><RadioWithIllustrationcurrentValue={layoutOrientation ?? "vertical"}diff --git a/apps/client/src/widgets/type_widgets/options/components/RadioWithIllustration.css b/apps/client/src/widgets/type_widgets/options/components/RadioWithIllustration.cssindex d774315c66..324d0dbb47 100644--- a/apps/client/src/widgets/type_widgets/options/components/RadioWithIllustration.css+++ b/apps/client/src/widgets/type_widgets/options/components/RadioWithIllustration.css@@ -1,3 +1,14 @@+/*+ * A card given over to a single illustrated choice, its heading standing in for the label such a+ * choice is too large to sit beside: no ground of its own, so the thumbnails read as the drawings+ * they are rather than as a filled-in control, and more room above and below than a row of text asks+ * for.+ */+.thumbnail-selector-option-card {+ --card-padding-block: 12px;+ --card-background-color: transparent;+}+.radio-with-illustration {list-style-type: none;margin-bottom: 0;diff --git a/apps/client/src/widgets/type_widgets/options/text_notes.css b/apps/client/src/widgets/type_widgets/options/text_notes.cssindex b44eb9077e..cb7d09ee09 100644--- a/apps/client/src/widgets/type_widgets/options/text_notes.css+++ b/apps/client/src/widgets/type_widgets/options/text_notes.css@@ -124,13 +124,6 @@}}-/* The illustrated choice reads as a pair of drawings rather than a filled-in control, so the card- gives it room and stands back behind it — the same treatment the layout choices have. */-.text-notes-toolbar-style .tn-card {- --card-padding-block: 12px;- --card-background-color: transparent;-}-/* Bootstrap gives a select the whole width of what holds it, which in a card row leaves the labelbeside it a word to the line. Sized to what it offers instead, and cut short rather than carriedacross the row — the bounds the option rows carried before these were card segments. */diff --git a/apps/client/src/widgets/type_widgets/options/text_notes.tsx b/apps/client/src/widgets/type_widgets/options/text_notes.tsxindex ad4499a282..58e7547392 100644--- a/apps/client/src/widgets/type_widgets/options/text_notes.tsx+++ b/apps/client/src/widgets/type_widgets/options/text_notes.tsx@@ -84,8 +84,8 @@ function ToolbarStyle() {const [ textNoteEditorType, setTextNoteEditorType ] = useTriliumOption("textNoteEditorType");return (- <div className="options-section text-notes-toolbar-style">- <Card heading={t("editing.editor_type.toolbar_style")}>+ <div className="options-section">+ <Card className="thumbnail-selector-option-card" heading={t("editing.editor_type.toolbar_style")}><CardSection><RadioWithIllustrationcurrentValue={textNoteEditorType}