date-tags-addon

date-tags-addon

A raw, clean, and highly functional CSS snippet to overhaul how date tags look in Obsidian.

Obsidian Date Tags Fix CSS

A raw, clean, and highly functional CSS snippet to overhaul how date tags look in Obsidian. Created by Waghmare.

Preview

Addon Preview

What it does

By default, Obsidian tags look generic. If you use tags like #jan-15 or #dec-25 to track dates, this CSS snippet completely transforms them into polished calendar pills.

  • Nukes the hashtag symbol cleanly in Editing View.
  • Renders a deep red calendar pill block with custom SVG icons.
  • Uses a brute force method for Reading View to swap out the messy default tag text with beautifully formatted dates (e.g. Date Preview ).

Installation

  1. Download the priority-tags-date-tags-fix.css file.
  2. Move it to your vault's snippet folder: YourVault/.obsidian/snippets/
  3. Open Obsidian and go to Settings > Appearance.
  4. Scroll to CSS snippets and hit the refresh icon.
  5. Toggle priority-tags-date-tags-fix on.

Usage

Just type your date tags in standard 3 letter format: #jan-1, #feb-29, #mar-31, etc. The snippet will automatically style them in both Editing and Reading views.

Generating the full CSS

To keep file size manageable while editing, you can generate the 366 lines of brute force code using this python script:

months = [
    ("jan", 31), ("feb", 29), ("mar", 31), ("apr", 30),
    ("may", 31), ("jun", 30), ("jul", 31), ("aug", 31),
    ("sep", 30), ("oct", 31), ("nov", 30), ("dec", 31)
]

for month, days in months:
    for day in range(1, days + 1):
        month_cap = month.capitalize()
        print(f'a.tag[href="#{month}-{day}"] {{ font-size: 0 !important; }}')
        print(f'a.tag[href="#{month}-{day}"]::after {{ content: "{month_cap} {day}"; font-size: 1rem !important; }}')

Credits

Built by Waghmare.

Related

How to Install

  1. Download the repository ZIP below
  2. Unzip it and find the CSS snippet file
  3. Move the CSS file into your vault's .obsidian/snippets/ folder
  4. Open Obsidian → Settings → Appearance → CSS Snippets → Enable it

Stats

Stars

3

Forks

0

License

MIT

Last updated 6mo ago

Categories