[css+template] eisenhower matrix

here’s my attempt at an eisenhower matrix (priority matrix)

it works by combining a template and css rules :

  • the template will create a tree structure and tag the root block with #.v-eisenhower-matrix
  • the css will look for the block tagged with #.v-eisenhower-matrix and apply styling/layout modifications
  • at any time, you can revert to the standard outlining view by removing the tag (or changing its name) as shown is the gif
  • colors and styling can be customized at the beginning of the css
  • the captions can be modified in the template

installation

1. create the template

copy-paste the following lines in a document (I keep all my templates in a single document for easy management)

show the template :
## #.v-eisenhower-matrix
:PROPERTIES:
:template: v-eisenhower
:END:
### [[TODO]]
####
####
####
### [[DECIDE]]
####
####
####
### [[DELEGATE]]
####
####
####
### [[ELIMINATE]]
####
####
#### 

it will create a template called v-eisenhower that looks like this

2. the css

copy the css rules at the bottom of your custom.css or use the stylus addon to load them

CODE v20210306 :

/* WIP css eisenhower matrix by cannibalox v202100306 */
/* works best with the `v-eisenhower` template        */
/* activate with:  `/template v-eisenhower		      */
/* or tag a block with `#.v-eisenhower-matrix`        */  
/* define vars */ 
[data-refs-self*="eisenhower-matrix"]{
	--eisen-caption-color: #fff;
	--eisen-caption-bg: #0000;
	--eisen-scrollbar-thumb: #f9f9f99e;
	--eisen-scrollbar-track: #0000;
	--eisen-outercaption-color: #979797b8;
	--eisen-todo-bgcolor: #4bad00a8;
	--eisen-decide-bgcolor: #0067beb8;
 	--eisen-delegate-bgcolor:#bf8300c7;
 	--eisen-eliminate-bgcolor:#9c003ecc;
	--eisen-bullet-color : #d9d9d9;
	--eisen-clover-borderstyle: none; /*eg: 3px solid white */
}

/* optionnal : add captions around the diagram */
div[data-refs-self*="eisenhower-matrix"] > .block-children:before {
	content: "↑ IMPORTANT";
	position: absolute;
	color: var(--eisen-outercaption-color);
	font-size: 12px;
	left: 44%;
	top: 0.5rem;
}  
div[data-refs-self*="eisenhower-matrix"] > .block-children:after {
	content: "URGENT ←";
	position: absolute;
	color: var(--eisen-outercaption-color);
	font-size: 12px;
	left: -1rem;
	top: 50%;
}  
div[data-refs-self*="eisenhower-matrix"]:before {
	content: "↓ NOT IMPORTANT";
	position: absolute;
	color: var(--eisen-outercaption-color);
	font-size: 12px;
	left: 43%;
	bottom: -0.5rem;
}  
div[data-refs-self*="eisenhower-matrix"]:after {
	content: "→ NOT URGENT";
	position: absolute;
	color: var(--eisen-outercaption-color);
	font-size: 12px;
	right: -2rem;
	top: 50%;
}  

/* blocks / col */
div[data-refs-self*="eisenhower-matrix"] > .block-children > div.ls-block {
	display: inline-block;
	width: 46%;
	overflow: hidden;
	margin: 5px;
	height: 14rem;
	}
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block {
	border:var(--eisen-clover-borderstyle);}
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block:nth-last-child(4) 
	{border-radius: 0 2rem 0 2rem; background-color: var(--eisen-todo-bgcolor);}
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block:nth-last-child(3) 
	{border-radius: 2rem 0 2rem 0; background-color: var(--eisen-decide-bgcolor);}
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block:nth-last-child(2) 
	{border-radius: 2rem 0 2rem 0; background-color: var(--eisen-delegate-bgcolor);}
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block:nth-last-child(1) 
	{border-radius: 0 2rem 0 2rem; background-color: var(--eisen-eliminate-bgcolor);}

/* clover contents */
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block > .block-children {
	overflow: auto;
	height: 12rem;
}
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block > .block-children .bullet {
	background-color:var(--eisen-bullet-color) !important;
}

/* scrollbar for each block */
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block > .block-children::-webkit-scrollbar-thumb {background-color:var(--eisen-scrollbar-thumb); border-radius: 0px;}
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block > .block-children::-webkit-scrollbar-track {background:var(--eisen-scrollbar-track); }

/* block titles */
	div[data-refs-self*="eisenhower-matrix"] > .block-children > div.ls-block > .flex-1.flex-row > div > .block-content {
		font-weight: 700;
		font-size: 0.7rem;
		text-align: center;
		margin-left: -1rem;
	} 
	div[data-refs-self*="eisenhower-matrix"] > .block-children > div.ls-block > .flex-1.flex-row > div > .block-content .page-reference {
		background:var(--eisen-caption-bg);
		border-radius: 10px;
	} 
	div[data-refs-self*="eisenhower-matrix"] > .block-children > div.ls-block > .flex-1.flex-row > div > .block-content .page-ref {
		color:var(--eisen-caption-color);
	} 
	/* remove bullet of the block title */
	div[data-refs-self*="eisenhower-matrix"] > .block-children > div.ls-block > .flex-1.flex-row > div .bullet {
		visibility: hidden
	} 

/* remove indent line ~ margin-left of table cells */
div[data-refs-self*="eisenhower-matrix"] > .block-children > .ls-block > .block-children {
	border: 0;
    margin: 0px !important;
}
div[data-refs-self*="eisenhower-matrix"] > .block-children {
	border:none;
    margin: 0px 0px 0 30px !important;
}

/* =============== END OF EISENHOWER MATRIX =====================*/

usage

once you have created the template and saved the css rules, invoke the command:
/Template
then choose v-eisenhower

VIDEO DEMO

notes:

  • this should work with custom themes, but may require some tweaking for margins, etc…
  • this is a display mode, thus the inner structure of the notes still rely on indented bullets. if you want to exit the matrix, you can use TAB or SHIFT TAB to indent/unindent bullets until they are not part of the eisenhower matrix

I almost forgot : if you want to replace the tag #.v-eisenhower-matrix by the auto-expanding eye icon (as seen in the gif)
20210306_NUC8_Jz3c3eSTHu
you can add these css rules:

/* vismode icon component by cannibalox */ 
/* part of the ls-vizmods-suite         */ 
a.tag[data-ref*=".v-"]:before {
   content:"👁";
   font-size: 0.75rem; 
   line-height: 0.75rem;
   }
a.tag[data-ref*=".v-"]:hover:before {
   padding-right:0.3rem;
   }
a.tag[data-ref*=".v-"]:hover {
   font-size: 0.75rem; 
   line-height: 0.75rem;
   }
a.tag[data-ref*=".v-"]{
   font-size: 0px; 
   font-family: iosevka, fira code, consolas, source code pro;
   color: #88e165;
   background-color: #1a2d23;
   border: 1px solid #a1c65d; border-radius: 3px;
   padding: 0 2px;
   }

I will reuse the same taxonomy for my other css addons.

5 Likes

This is awesome. Thank you for building and sharing!

I find my frequent use case is to classify the results of the NOW page (or query). Is there a way at all to put the results of a query into the matrix?

Edit: @tienson pointed me to this:
You can add queries into the matrix, check this tweet

That’s awesome, thank you very much @tienson!

Logseq’s ability to live-edit the query results really rocks. I find that I can take chaotic and unorganized notes peppered with TODOs, and still get organized very easily!

Could you elaborate on what the query is and the NOW page? How you organize todos?

@cannibalox
This template is amazing. I’ve been using a slightly modified version of his for an OKR quad and very similar styling, but noticed it has broken with the latest beta. I"m assuming because of some changes in the way the beta perhaps handles styling or divs? Just wondering if you have an updated version of it since I am having trouble figuring out what has changed and broken (and you’re obviously amazing at this stuff.).

thanks!

1 Like

hello,it looks amazing,but I find it can not work in version 0.59 correctly.

1 Like

As a complete noob: could this be shipped as a plug-in? It’s amazing :slight_smile:

sorry for the late fix.can’t edit the first post toupdate.
updated for logseq 0.6.x, now available as part of logtools plugin:

GitHub - cannibalox/logtools: utilities for Logseq (kanban, image gallery, priority matrix, ...)

or on the marketplace

Thank you for your great job! But when I installed the plugin I encountered some problem.

I have installed it, copy the template code, then I got the error below:

It seems like CSS worked but the template doesn’t worked well. If I simply tag a block with #.v-eisenhower, it looks like:

Does the plugin worked for 0.8.x? Or something else I missed?

hey I’m sorry for the trouble, the template in the fist post is using a deprecated syntax… unfortunately I can’t edit my older post.

the correct template for LS 0.8.x should be :

- #.v-eisenhower-matrix
  template:: eisenhower-matrix
	- [[TODO]]
		-
		-
		-
	- [[DECIDE]]
		-
		-
		-
	- [[DELEGATE]]
		-
		-
		-
	- [[ELIMINATE]]
		-
		-
		-

make sure your are using the latest version of Logtools from the marketplace or here: https://github.com/cannibalox/logtools

4 Likes

I am trying to use the date picker to add a due date to a task. I noticed the menu bar is white due to the CSS. Is there a way for the menu bar to stay transparent?

I am guessing you are using a different background to avoid the line going through Urgent?

Eisenhower Matrix also works well with putting a TODO next to the task. However, it is navigating the menu due to it being all white. Is there another workflow you use to manage the tasks in the matrix?

I use a dark theme+custom css, what theme are you using?
I’ll try to make it work for default light theme, but not have a lot of time atm, you can also tweak the value/colors in the installed script if you don’t want to wait or switch to dark mode.

1 Like

I appreciate your willingness to look into making the update.


I have used the css config you provide ,it seems have a problem on my computer, can you give me some advice ?

it’s probably the theme that changes the positionning of the elements, you can try to add rules in your custom.css and tweak the values

div[data-refs-self*="eisenhower-matrix"]:before {
	content: "↓ NOT IMPORTANT";
	position: absolute;
	color: var(--eisen-outercaption-color);
	font-size: 12px;
	left: 43%;
	bottom: -0.5rem;
}  
div[data-refs-self*="eisenhower-matrix"]:after {
	content: "→ NOT URGENT";
	position: absolute;
	color: var(--eisen-outercaption-color);
	font-size: 12px;
	right: -2rem;
	top: 50%;
}  

[/quote]
you should tweak the values for “left, bottom, right, top” so trhat they work for your theme, maybe in the ‘not urgent’ section, try to replacebottom: -0.5rem; by bottom: 3rem
and for ‘not urgent’, try to replace top:50% by top: 52%
I’m not sure which values would work with this custom theme though, so you need to try different values.

I have tried it , but it doesn’t seems working after I tweak the values for “left,bottom,right,top”,my software version is 0.9.1

hmm…it should work in 0.9.1 (I’m using 0.9.1 nightly).
are you able to move the elements at all ?
if you need to find the correct values, you can use DevTools to tweak the values, then copy trhe rules to your custom.css. a breakdown:

in logseq, on a page with the priority matrix, hit ctrl+shift+i (or F12) to open the DevTools panel, it should look like the screen below more or less

  1. use the Select tool (icon on top left of the devtools panel)

  2. point to one of the labels from the priority matrix, this should bring you to the relevant section of the html source code

  3. in the code panel, you should see the same code as in the screenshot, locate the first ::before highlighted in the screenshot and click on it, this should correspond to the NOT IMPORTANT label from the priority matrix (at the bottom)

  4. in the css tab, you should see the css rule, tweak the values for left and bottom using your cursor up and down keys or type in numbers and validate with enter, the element should move in realtime (if you use the arrows keys) so you can tweak values until its position looks correct. Once it’s in the right position : in the css panel, use the right mouse button and chose copy rule (see screenshot). Paste that rule in your custom.css and save

  5. do the same steps for the other label (the NOT URGENT should be the last ::after in the code from the first screenshot, highlight in green)

I hope this can help.

thank you for your help , I have solved the problem :+1:

Hi,

I was super excited to find this Template it looks great and is exactly what I’m looking for.

Sadly, for me it doesn’t render correctly.

  • I’m on logseq 0.10.3 default dark theme
  • I have LogTools 0.1.1
  • I copied the CSS definitions to my custom.css
  • I’m using the updated Syntax for the template

Still I’m encountering the same issue as described above

Does anyone have a hint for me?

Cheers,
Rhalina