Skip to content

TechWhizKid/obsidian-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom CSS snippets for Obsidian.


About CSS snippets

CSS is a language to describe how to present a HTML document. By adding CSS snippets you can redefine parts of obsidian user interface, such as size and color of headings.

Obsidian looks for CSS snippets inside vault configuration folder, usually a folder named .obsidian.

To add a CSS snippet on Desktop, follow these steps —

  1. Open settings.
  2. Under Appearance > CSS snippets, select Open snippets folder icon.
  3. In the snippets folder, create/copy a CSS file that contains the snippet.
  4. In Obsidian, under Appearance > CSS snippets, select Reload snippets icon to see the snippet in the list from where you can enable it.

To add a CSS snippets on a Mobile/Tablet, you will need to follow these steps —

  1. Use the file manager to access the configuration folder and place the snippet.css in the snippet folder.

Available CSS snippets

  • Lets you specify the image position in alt text. Apply settings by using the following syntaxes —
[[<image_file_name>|left]]
[[<image_file_name>|center]]
[[<image_file_name>|right]]
[[<image_file_name>|grid]]
  • Adds a custom horizontal line with obsidian logo in the middle.
  • Adds extra callout types.
  • Adds a custom graph view theme.
  • Adds custom header font and header font colors.
  • Modifies the highlighted text background color to match the graph-mod's theme.
  • Modifies the titlebar buttons.
  • Adds an 🪨 obsidian logo in the empty tab.
  • The table takes up 100% of the width even if there is only a single column.
  • Adds border radius to every table cell and adds a 2px spacing between them (optional).
  • The spacing can be easily removed by uncommenting the following part of the CSS snippet —
. . .

/* Uncomment the lines below to remove border spacing and combine all table boxes together */

/* === erase this line to uncomment === //

:root table {border-spacing: 0;}
tr td, tr th {border-radius: 0;}
th:first-child {border-top-left-radius: var(--table-border-radius);}
th:last-child {border-top-right-radius: var(--table-border-radius);}
tr:last-child td:first-child {border-bottom-left-radius: var(--table-border-radius);}
tr:last-child td:last-child {border-bottom-right-radius: var(--table-border-radius);}
:root :is(td, th) {border-width: 0 var(--table-border-width) var(--table-border-width) 0;}

/* */
  • Now the table will look like this —

About

Custom CSS snippets for 🪨 Obsidian.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages