mgmeyers / obsidian-kanban

Create markdown-backed Kanban boards in Obsidian.
https://publish.obsidian.md/kanban/
GNU General Public License v3.0
3.2k stars 188 forks source link

[Feature]: Set arbitrary min/max card height #332

Open bjornfiles opened 3 years ago

bjornfiles commented 3 years ago

Goal or desired outcome of this feature

Ability to set minimum and maximum card height by lines and/or by pixels would be fantastic for making them feel… more like actual cards (and more like Trello).

Can you think of any alternatives or work-arounds?

No.

ronan-smith commented 1 year ago

I use task lists inside cards and this can make cards become quite unwieldily. Wonder if there's a CSS snippet we can use in Obsidian as a workaround?

I'm not sure which CSS selector targets the cards but I'd imaging setting a pixel height value and setting overflow: scroll would be a good start?

ronan-smith commented 1 year ago

To @bjornfiles and for anyone else interested in a workaround, I've got the following working successfully:

.kanban-plugin__item {
  max-height: 200px;
  overflow-y: scroll;
}

Add the CSS to a blank CSS file, mine is called kanban-height.css, and then add this to Obsidian's snippet folder - enable it under the Appearance menu at the bottom.

This currently also effects the cards while they are being edited, which might be unwanted, perhaps there's another CSS class that can be added to the selector to show the cards normally when they are being modified. Can @mgmeyers provide the correct selector?

v3rso commented 5 months ago

Going off of @ronan-smith's workaround, the following expands the card while it's being edited.

.kanban-plugin__item {
    max-height: 200px;
    overflow-y: scroll;

    &:has(.markdown-source-view) {
        max-height: none;
        overflow-y: visible;
    }
}