Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Tag Classes

agrisonagrison179 downloads

Automatically adds note tags as CSS classes on the view container for tag-based styling.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

Style your notes based on their tags without having to manually add a cssclasses to the frontmatter.

Tag Classes automatically injects your note's tags as CSS classes on the view container, so you can target any note from a CSS snippet using nothing but its tags.

If you already use tags to organize your notes, then you're not forced to also add a cssclasses property just to style them. Tag Classes automatically turns your existing tags into CSS classes, so your tags do double duty.


How it works

Every tag on a note gets added as a CSS class on the view container. A note tagged #recipe gets the class .tag-recipe. That's it.

A note with these tags:

---
tags: [recipe, italian]
---

...will have these classes added to its view container:

.tag-recipe  .tag-italian

You can then style it from any CSS snippet in .obsidian/snippets/:

.tag-recipe .markdown-preview-view {
  background: #fffbf5;
  font-family: Georgia, serif;
}

.tag-recipe h1, .tag-recipe h2 {
  color: #c0392b;
}

No cssclasses in the frontmatter needed. Your tags are enough.


Installation

From the Community Plugin store

  1. Open Settings → Community plugins
  2. Search for Tag Classes
  3. Install and enable

Manual installation

  1. Download main.js and manifest.json from the latest release
  2. Create a folder at <your-vault>/.obsidian/plugins/tag-classes/
  3. Copy both files into that folder
  4. Reload Obsidian and enable the plugin under Settings → Community plugins

Usage

Once enabled, tags are automatically applied as classes — nothing else to configure.

Targeting notes in CSS snippets

Create a file in .obsidian/snippets/ (e.g. tag-styles.css):

/* Notes tagged #recipe */
.tag-recipe .markdown-preview-view {
  background: #fffbf5;
  font-family: Georgia, serif;
}

/* Notes tagged #draft — add a visual watermark */
.tag-draft .markdown-preview-view::before {
  content: "DRAFT";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 6rem;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.04);
  pointer-events: none;
}

/* Notes tagged #important — colored left border */
.tag-important .markdown-preview-view {
  border-left: 4px solid #f59e0b;
  padding-left: 1rem;
}

/* Subtag #project/personal → .tag-project-personal */
.tag-project-personal h1 {
  color: #7c3aed;
}

Enable your snippet under Settings → Appearance → CSS snippets.


Settings

Setting Default Description
CSS prefix tag- Prefix prepended to every tag name. A tag recipe becomes class tag-recipe.
Sanitize class names true Replaces characters invalid in CSS (e.g. / in subtags) with -. Disable if you want raw tag names.

License

MIT

92%
HealthExcellent
ReviewSatisfactory
About
Inject note tags as CSS classes on each view container to enable tag-based styling. Style notes directly with tag selectors in your CSS snippets (e.g., .tag-recipe .markdown-preview-view) without adding cssclasses to frontmatter.
TagsCSSSnippets
Details
Current version
1.0.1
Last updated
2 months ago
Created
2 months ago
Updates
2 releases
Downloads
179
Compatible with
Obsidian 1.0.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
agrisonagrison
github.com/agrison
GitHubagrison
  1. Community
  2. Plugins
  3. Tags
  4. Tag Classes

Related plugins

CSS Editor

Edit CSS snippet files.

Snippetor

Create and tweak common snippets.

Style Settings

Adjust theme, plugin, and snippet CSS variables.

Lapel

Show the heading levels in the gutter of the editor.

Admonition

Admonition block-styled content.

TagFolder

Show tags as folder.

Custom Frames

Turn web apps into panes using iframes with custom styling. Also comes with presets for Google Keep, Todoist and more.

Checklist

Consolidate checklists across all files into a single view.

Badges

Add inline badges/callouts to notes.

Tag Wrangler

Rename, merge, toggle, and search tags from the tag pane.