How to show all tags in color?

Hi,

is there a way to show all tags in a markdown file at once?

I don’t mean this

image

but this:

I want to test, if all my tags are neccessary and have a readable color combination.

Thanks for advice, code or something else.

Here’s a snippet I ran across ages ago. Forgive me for not recalling the source. You can add your own tag & color combinations. Unfortunately, it only produces the desired results in Reading Mode, which isn’t ideal.

/* ====== Tag Pills ======== */
.tag:not(.token) {
	background-color: var(--text-accent);
	border: none;
	color: white;
	font-size: 11px;
	padding: 1px 8px;
	text-align: center;
	text-decoration: none;
	display: inline-block;
	margin: 0px 0px;
	cursor: pointer;
	border-radius: 14px;
}
.tag:not(.token):hover {
	color: white;
	background-color: var(--text-accent-hover);
}
.tag[href^="#obsidian"] {
	background-color: #4d3ca6;
}
.tag[href^="#important"] {
	background-color: red;
}
.tag[href^="#complete"] {
	background-color: green;
}
.tag[href^="#inprogress"] {
	background-color: orange;
}
.tag[href^="#the_rhino_has_escaped"] {
	background-color: orangered;
}
.tag[href^="#not_my_fault"] {
	background-color: #f06098;
}
	.tag[href^="#my_fault"] {
		background-color: #ff0f0f;
	
}
2 Likes

The problem is not to colorize the tags. The problem is how to list them all without writing them by hand. The result should be colorized, as in the image.

1 Like

Hello @merlinuwe ,

If what you need is just a way to view all tags to can enable the tag pane.

Settings → Core Plugins → Tag pane

The tags in the tag pane are not colored.

i don’t know how to show inline like your screenshot, but i sometimes do pull unique values using dataview. i modified a bit for you to pull tags. this will give in a long list (from top to bottom). i think with some css you could flatten it out (making it all inline)

```dataview
LIST WITHOUT ID
FLATTEN file.tags AS allmytag
GROUP BY allmytag
```
1 Like

@efemkay Can you filter it ? For example I use a lot of sub tags for example # Server/Email/Relay

Can I place a filter for everything under Server ?

Yeah u can. Dataview uses SQL like query as well as js, but I’m more comfortable with SQL like… So if u want to filter u can either use FROM if it is folder or another common tag, or WHERE for more flexible “filter”

Here is to list all tags in notes from folder Areas/Productivity

```dataview
LIST WITHOUT ID
FROM "Areas/Productivity"
FLATTEN file.tags AS allmytag
GROUP BY allmytag
```
1 Like

@Zektor just realised u asked for nested tags. i quickly tried just now, it can filter based on your tags (revised example here). but it will also pull other tags that exists within the same note. so if that note has #Server/Email/Relay and #Urgent, the latter one will also be listed

i’m tagging this thread #dataview so that other dataview experienced users can help out.

LIST WITHOUT ID
FROM #Server
FLATTEN file.tags AS allmytag
GROUP BY allmytag
3 Likes

Yes, you’ve got it. Thank you very much!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.