Snippets

CSS snippets for use with Obsidian

obsidian-snippets

CSS snippets for use with Obsidian

Files prefixed with z- change things globally and are meant to be turned on only when needed (e.g. for printing).

Optional classes

Add these to a note's cssclasses property. Naming follows two patterns:

  • no-<area>-<thing> turns something off (e.g. no-bases-header)
  • <area>-<modifier> turns something on (e.g. ul-striped)
ClassFileEffect
no-bases-headerbases.cssHide the Bases toolbar
no-bases-theadbases.cssHide Bases table column headings
no-bases-group-propertybases.cssHide the group-by property name
callout-borderscallouts.cssShow a border on every callout
no-checkbox-strikeoutcheckboxes.cssDon't strike out completed tasks
no-code-copy-buttoncode.cssHide the copy button on code blocks
no-dataview-inline-fieldsplugin-dataview.cssHide Dataview inline fields
no-embed-decorationsembeds.cssMake embeds blend into the page
no-embed-indentembeds.cssRemove embed padding, border, and background
no-embed-titlesembeds.cssHide embed titles
no-embed-headingsembeds.cssHide h1–h4 inside embeds
embed-show-as-h1, -h2, -h3embeds.cssStyle embed titles as headings
no-h-underlineheaders-h1-h2-h3-underline.cssNo underline on h1–h3
no-h1-underline, no-h2-underline, no-h3-underlineheaders-h1-h2-h3-underline.cssNo underline on one heading level
h1-clear-float, h2-clear-float, h3-clear-floatheaders-h1-h2-h3-underline.cssStart headings below floated content
no-h-spacingheadings.cssRemove extra space above headings that follow body text
no-h-margin-toppage.cssRemove all space above headings
no-external-link-iconlinks.cssHide the external link arrow
no-link-underlinelinks.cssDon't underline internal links
ul-striped, ul-striped-darklists.cssStripe list items
no-ul-bulletslists.cssHide bullets and indentation guides
ul-narrowlists.cssReduce list indentation
ul-flattenlists.cssRemove all list indentation and bullets
no-ul-margin-toplists.cssRemove the space above lists
ul-float-imageslists.cssFloat images in list items (experimental)
no-mermaid-resizemermaid.cssShow Mermaid diagrams at natural size
no-inline-titlepage.cssHide the inline title
no-p-block-marginpage.cssRemove paragraph spacing
no-text-wrappage.cssDon't wrap text
responsive-columnspage.cssFlow the page into columns by screen width
print-h1-page-breakprint.cssStart each h1 on a new printed page
print-two-columns, -three-, -four-print.cssPrint in columns
no-table-centertables.cssDon't center tables
no-table-hovertables.cssDon't highlight rows on hover
table-invisibletables.cssHide table borders and shading
table-small-texttables.cssSmaller table text (experimental)

Callout options

Add after the callout type, e.g. > [!info|sidebar|no-title].

OptionEffect
sidebarFloat the callout to the right at 40% width
no-iconHide the icon
no-titleHide the title (and icon)
no-backgroundRemove background, margin, and padding
borderShow a border
cleft, crightOffset left or right, for conversations
portrait-right, portrait-right-10 … -50Float an image right with no title or background

Image spans (image-placement.css)

Wrap an embed in a span, e.g. <span class="portrait-right">![[img.png]]</span>.

portrait-right (30%), portrait-right-20, -25, -30, -35, -50, portrait-right-200px, icon-right, icon-left

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

5

Forks

0

Last updated 20d ago

Categories