Skip to content

Instantly share code, notes, and snippets.

@onespaceman
Last active March 6, 2024 18:14
Show Gist options
  • Save onespaceman/71c31edf4bed5d33d58eee1bacd127af to your computer and use it in GitHub Desktop.
Save onespaceman/71c31edf4bed5d33d58eee1bacd127af to your computer and use it in GitHub Desktop.
Silverbullet Admonitions

Admonition styles for silverbullet
Add them to your custom STYLES
All icons from https://icons.getbootstrap.com/

Abstract

.sb-admonition[admonition="abstract"] {
  --admonition-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16"><path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1z"/><path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0z"/></svg>'); 
  --admonition-color: dodgerblue;
}

Info

.sb-admonition[admonition="info"] {
  --admonition-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/></svg>'); 
  --admonition-color: turquoise;
}

Question

.sb-admonition[admonition="question"] {
  --admonition-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-question-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94"/></svg>'); 
  --admonition-color: chartreuse;
}

How to make more:

  1. Find and icon at https://icons.getbootstrap.com/ and copy HTML from the bottom right
  2. Delete the spaces and linebreaks between each line to condense it to one line.
  3. Paste the svg where it says PASTE SVG HERE
  4. Replace the color with your choice of hex color or a named color
.sb-admonition[admonition="Insert Keyword of Your Choice Here"] {
  --admonition-icon: url('data:image/svg+xml,PASTE SVG HERE; 
  --admonition-color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment