Skip to content

🌟 Obsidian Element Enhancer - add custom classes to Obsidian elements

Notifications You must be signed in to change notification settings

jparkerweb/obsidian-element-enhancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Obsidian Element Enhancer

Add custom classes to Obsidian elements πŸ”¨

Allthough Obsidian is very customizable, it doesn't allow for adding css classes to Markdown elements out fo the box. For example, if I wanted to change the color or appearacne of a specific list of items I wouldn't be able to do it; I would be locked to changeing it for an entire page or vault by using page level css or a theme.

Obsidian Element Enhancer implements a simple script that enables the ability to apply custom css classes to any adjacent Markwon element for styling. πŸŽ‰

Instalation

  1. Install the Dataview plugin and enable JavaScript Queries dataview
  2. copy the scripts/obsidian-element-enhancer.js file to your Obsidian vault (suggested to save it to a "./scripts" folder).

Usage

  1. Enter the following div on a new line before the markdown element you want to add custom classes to (note: you must insert a blank line between the div and target markdown element):

    <div class="🌟 example1 example2 example3"></div>
  2. Add the following as the last line in your note. Make sure to update the path to the script that you copied to your vault in the Installation step above.

    `$= await dv.view("scripts/obsidian-element-enhancer", "🌟")`



Example

example

bullet cards in example can be found here β‡’ obsidian-bullet-cards


note: live preview is not supported


My Obsidian GitHub Projects

About

🌟 Obsidian Element Enhancer - add custom classes to Obsidian elements

Resources

Stars

Watchers

Forks

Releases

No releases published