[css] trigger columns/kanban view with tags

a css kanban/columns view for children blocks, triggered by tags

usage:

tag a block with one of the following tags to display its children blocks in a columns layout :

  • #kanban : automatically adjust the columns width depending on the number of bullets
  • #kanban-small : same as above but with smaller fonts and a hover ‘zoom’ (useful when the classic kanban feels cramped)
  • #kanban-w100 : will set each column width to 100 px
  • #kanban-w200 : will set each column width to 200 px
  • #kanban-w300 : will set each column width to 300 px
  • #kanban-w400 : will set each column width to 400 px

it’s better to avoid nested kanbans

DEMO

more images

click to unfold default layout ![image|690x310](upload://sus8leM7mHjeAiHLjdDkJ7CLOAO.png)

same text using #kanban default setting (auto-adjust width to fit the page)

same text using #kanban-small default setting (auto-adjust width to fit the page)

using #kanban-w200 (width=200px, scrollable container)

using #kanban-w300 (width=300px, scrollable container)

using #kanban-w400 (width=400px, scrollable container)

code

click to unfold
/* css columns view for child blocks by cannibalox v20210220 */
/* use: inline tag #kanban, #kanban-small or #kanban-wXXX    */
/* try:  #kanban-w200,#kanban-w300, #kanban-w400             */

div[data-refs-self*="kanban"] > .block-children {
	display: inline-flex;
	position: relative;
	overflow-x: auto;
	overflow-y: hidden;
	margin: 10px;
	}
div[data-refs-self*="kanban"] >.block-children > div {
	display: inline-block;
	width: 400px;
	padding-right: 3px;
	}

/* #kanbansmall : smaller font with hover zoom */
div[data-refs-self*="kanban-small"] > .block-children .block-content {
	font-size: 11px;
	font-weight: 300;
}
div[data-refs-self*="kanban-small"] > .block-children .block-content:hover {
	font-size: 14px !important;
	min-width: 100px;
	margin: 0 10px;
}
/* #kanban-w[100-300] : force width of the columns */
div[data-refs-self*="kanban-w100"] > .block-children .block-content {
	width:100px;
}
div[data-refs-self*="kanban-w200"] > .block-children .block-content {
	width:200px;
}
div[data-refs-self*="kanban-w300"] > .block-children .block-content {
	width:300px;
}
div[data-refs-self*="kanban-w300"] > .block-children {
	border: 1px solid var(--ls-block-bullet-border-color);
	padding: 10px 0;
}
div[data-refs-self*="kanban-w400"] > .block-children .block-content {
	width:380px;
}

install

use stylus extension or copy/paste at the bottom of your custom css (backup first)

source: GitHub - cannibalox/logseq-dark-hpx: CSS snippets and themes for www.logseq.com

11 Likes

Is it possible to make this to hide all bold keyword for flashcard purpose?

Is this custom.css still working? – It used to work for me but it stopped working a month ago. I wonder if anyone else has the same problem?

1 Like

I need to update the css to match changes in 0.5.6+, sry for the trouble. (it will be fixed though)

2 Likes

an update for the column view/kanban css if available here as a plugin : https://github.com/cannibalox/logtools
(working with logseq 0.6.x)

1 Like

Thank you a lot for this function! I really love it!
There may be something wrong with my network, I can’t download it from market. So I copied my fravourite part of your code from github (kanban part) to my custom.css, It works well.
The only thing I feel confused about is that I have no scrollable container. Sorry I know nothing about coding. Is scrollable container a part of kanban, or it’s defined by other parts of custom.css?
Sorry again for my stupid question.

Maybe inspirations from Airtable.com would be helpful:
Introduce Kanban boards as a new primitive - #18 by gww