Hide Block Properties when Block is collapsed

I have a love-hate relationship with page- and block-properties. I love them because they are a excellent help in organising my graph. Queries are such an easy way to bring back anything with the right properties asigned.

But they look so messy at the moment. They clutter everything. My example here is a list of poems:

With all that block properties, it really isn´t a list of block after all, it´s a mess. And mind you, these are collapsed blocks. The actual poem isn´t even showing.

I am helping myself with two workarounds at the moment, one being a child block with the same name:
grafik

and - mabye the better one - making the properties a child block and adding yet another property “title” to make the query useable.

grafik

I can not mix the two workarounds of course, because than my query looks something like that:

Hope you get what i am aiming for here. I love the properties, but they can take up a lot of room if they show up even when collapsed. There are some Feature Requests here to hide properties, but they don´t seem to get anywhere.

Greerings and Thank you for your help

1 Like

To hide the properties of collapsed blocks, try adding this in file custom.css:

div[data-collapsed] div.block-properties {
    display: none;
}

There is an option in config.edn that should do what the OP wants but doesn’t.

 ;; By default, a block can only be collapsed if it has some children.
 ;; `:outliner/block-title-collapse-enabled? true` enables a block with a title
 ;; (multiple lines) can be collapsed too. For example:
 ;; - block title
 ;;   block content
:outliner/block-title-collapse-enabled? true

I guess this should apply to properies also I think.

Thanks for the effort, but this does not work.

Does this qualify as a bug-report then? I am surprised that it only seems to disturb me :slight_smile:

1 Like

It works to me and it is straightforward on what it does. Are you looking for something different? If you plan to report it, an accurate description is required.

Maybe i made a mistake in the custom.css. Here is how it looks:

But the block-properties still show. Here is an example of an open block vs a collapsed block:
grafik

I hope this example makes it more accurate. I want to hide the block-properties for the collapsed block.

Thank you so much for helping me on this one. Logseq Version is 0.9.20 fyi.

Sure. Each css rule should be separate. Your own custom.css should look like this:

/* Wrap text in query table */
td {
    white-space: pre-wrap !important;
}

/* Hide the properties of collapsed blocks */
div[data-collapsed] div.block-properties {
    display: none;
}
1 Like

This hides the block properties for both collapsed and expanded blocks, but for me this will totaly do it.
I can see (and edit) them when i click in the block. This declutters my pages tremendously. Thanks!

1 Like

Apparently this can’t be done reliably, the reason is described in this issue (in the comments): Show handle to collapse blocks and hide properties · Issue #7086 · logseq/logseq · GitHub

I have these in my custom.css, maybe they are of use to you:

/* Styles for Auto-Hiding and Revealing on Mouse Hover for Block Properties */
/* Styles for displaying block properties */
.block-properties {
  display: none;
  position: absolute;
  transform: translateX(0%); /* Move the properties horizontally aligned with the ".block-content-inner" DIV Left Margin */
  border-radius: 5px;
  padding: 10px;
  border: 1px solid var(--ls-secondary-border-color); /* Add custom border color from pre-defied variables */
  background: var(--ls-primary-background-color)
}
/* Show block properties on hovering .block-content-inner */
.block-content-inner:hover ~ .block-properties {
  display: block;
  opacity: 1;
  z-index: 999;
}

/* Override styles for block properties in right sidebar */
#right-sidebar .block-properties {
  display: block;
  position: relative;
}

I have the block properties always hidden for both collapsed and uncollapsed blocks but they will show on hover. To edit them one has anyways to enter edit mode on the block. Because most properties are also links (dates, tags, etc) I will have the block properties to always show if the block is opened in the right sidebar.