obsidian-tasks-group / obsidian-tasks-custom-icons

Replace emojis used in Obsidian Tasks with monotone SVGs (obsidian css snippet generator)
58 stars 9 forks source link

Obsidian Tasks Custom Icons

This project was created by Phil Ricketts - @replete - and moved to obsidian-tasks-group in May 2024.
Many thanks Phil for all the work on this.

This repository contains a commandline tool (for developers/designers) to easily create CSS snippets that when added to Obsidian will replace the emojis used by the Obsidian Tasks with monochrome icons matching the text colour.

As a Tasks end-user, you can simply install one of the generated CSS snippets below to your obsidian vault to replace the Tasks Emoji Format emojis (in Live Preview or Reading modes) with monochrome icons.

Lucide-based Icon set

Lucide-based icon theme screenshot

Download Lucide CSS Snippet (Icons modified from https://lucide.dev)

Lucide-based Icon set 2

Lucide-based icon theme 2 screenshot

Download Lucide2 CSS Snippet (Icons modified from https://lucide.dev)

Incomplete icon sets

These icon sets are incomplete and are not recommended for use. They are included here for reference.

Creating a custom icon set

Prerequisites: Node.JS must be installed. I cannot provide support if this is unfamiliar, but it is fairly straightforward:

Unicode reference

The unicode reference for the emojis used in the Task Emoji Format is as follows:

Emoji Unicode
🆔 U+1F194
🏁 U+1F3C1
📅 U+1F4C5
📍 U+1F4CD
🔁 U+1F501
🔗 U+1F517
🔺 U+1F53A
🔼 U+1F53C
🔽 U+1F53D
🛫 U+1F6EB
U+23E9
U+23EB
U+23EC
U+23F0
U+23F3
U+26D4
U+2705
U+274C
U+2795
📝 U+1F4DD

CSS Snippet details

This tool generates CSS snippets usable by Obsidian for the purpose of replacing the Task Emojis Format emojis for task lines in obsidian notes. It currently uses the following rules for styling, which only applies the monochrome fonts to task lines in the normal editor, and task dataview. This works for Live Preview and Reading mode, though the rule could easily be adapted to also apply to source mode view.

/*! License info */
@font-face {
    font-family: 'TasksMonoEmojis';
    src: url('data:@file/octet-stream;base64,DO_NOT_USE_THIS_CSS_EXAMPLE') format('woff2');
    unicode-range: U+1F194, U+1F3C1, U+1F4C5, U+1F4CD, U+1F4DD, U+1F501, U+1F517, U+1F53A, U+1F53C, U+1F53D, U+1F6EB, U+23E9, U+23EB, U+23EC, U+23F0, U+23F3, U+26D4, U+2705, U+274C, U+2795;
    /* 🆔, 🏁, 📅, 📍, 📝, 🔁, 🔗, 🔺, 🔼, 🔽, 🛫, ⏩, ⏫, ⏬, ⏰, ⏳, ⛔, ✅, ❌, ➕ */
    /*! Generator: obsidian-tasks-custom-icons v1.0.6 https://github.com/obsidian-tasks-group/obsidian-tasks-custom-icons */
}
span.tasks-list-text,
.cm-line:has(.task-list-label) [class^=cm-list-],
span.task-extras,
.tasks-postpone,
.tasks-backlink,
.tasks-edit::after {
    font-family: 'TasksMonoEmojis', var(--font-text);
}
span.task-extras {
    display: inline-flex;
    align-items: flex-start;
    margin-left: 0.33em;
}

Please open an issue in github if you discover any issues.