Skip to content

Build your personal knowledge base with Trilium Notes

style(share): pad shared collections and draw one border under the title

Elian Doran022e1f899793
diff --git a/apps/client/src/widgets/note_bars/CollectionProperties.tsx b/apps/client/src/widgets/note_bars/CollectionProperties.tsx
index 044221375e..fd659f29ab 100644
--- a/apps/client/src/widgets/note_bars/CollectionProperties.tsx
+++ b/apps/client/src/widgets/note_bars/CollectionProperties.tsx
@@ -56,9 +56,15 @@ interface CollectionPropertiesProps {
/**
* The bar above a collection that switches its view, sets its options and holds the view's own
* controls, such as a calendar's navigation. A shared page keeps only the view's own controls, as a
- * visitor cannot change the note.
+ * visitor cannot change the note, and has no bar for a view without any.
*/
-export default function CollectionProperties({
+export default function CollectionProperties(props: CollectionPropertiesProps) {
+ return isShare && !props.centerChildren && !props.rightChildren
+ ? null
+ : <CollectionPropertiesBar {...props} />;
+}
+
+function CollectionPropertiesBar({
note,
centerChildren,
rightChildren,
diff --git a/packages/share-theme/src/content/app_view.css b/packages/share-theme/src/content/app_view.css
index 4d2a00fe9e..4cf156bf9b 100644
--- a/packages/share-theme/src/content/app_view.css
+++ b/packages/share-theme/src/content/app_view.css
@@ -1,4 +1,7 @@
+/* The app's views pad themselves by the margin `scrolling_container.css` sets in the app. */
#content.app-view > :is(.share-collection, .share-note-view) {
+ --content-margin-inline: 24px;
+
position: relative;
display: flex;
flex-direction: column;
@@ -18,6 +21,16 @@
}
}
+@media (max-width: 48em) {
+ #content.app-view > :is(.share-collection, .share-note-view) {
+ --content-margin-inline: 8px;
+ }
+}
+
+#content.app-view:has(.collection-properties) > #title-row {
+ border-bottom: 0;
+}
+
html.has-scripts:not(.app-view-shown) #content.app-view > :is(.share-collection, .share-note-view) {
> :not(img) {
visibility: hidden;