Skip to content

Commit f56e366

Browse files
committed
obsidian callouts
1 parent 752439b commit f56e366

File tree

6 files changed

+79
-6
lines changed

6 files changed

+79
-6
lines changed

β€Žcontent/blog-posts/2025-06-17-making-callouts-obsidian.md

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ To use this in your note, write:
4242

4343
This is how it looks in Obsidian:
4444

45-
![alt text](../../img/blogs/obidian_callouts/fig1.png)
45+
![alt text](../../img/blogs/obsidian-callouts/fig1.png)
4646

4747
And voilΓ , Obsidian will render it with your defined styles.
4848

@@ -77,7 +77,7 @@ Use it in your note like this:
7777

7878
This will render as:
7979

80-
![alt text](../../img/blogs/obidian_callouts/fig2.png)
80+
![alt text](../../img/blogs/obsidian-callouts/fig2.png)
8181

8282
Most of the ones I've made have been for equations, theorems, figures or other mathematical content, but you can create any type of callout you need. I even made some "warning" ones:
8383

@@ -108,20 +108,93 @@ Use them like this:
108108

109109
This will render as:
110110

111-
![alt text](../../img/blogs/obidian_callouts/fig3.png)
111+
![alt text](../../img/blogs/obsidian-callouts/fig3.png)
112112

113113
---
114114

115+
## Foldable Callouts
116+
117+
You can make callouts foldable by adding `+` or `-` after the label:
118+
119+
* `+` β†’ Open by default, but collapsible
120+
* `-` β†’ Closed by default
121+
122+
```markdown
123+
> [!figure]+
124+
> This is a **figure** callout. Great for highlighting diagrams or illustrations.
125+
126+
> [!figure]-
127+
> This one starts **closed** by default.
128+
```
129+
130+
This works on both built-in and custom callouts.
131+
132+
![alt text](../../img/blogs/obsidian-callouts/fig4.png)
133+
134+
---
135+
136+
## Creating a Colour Overlay on a Dark Base
137+
138+
If you're using a dark theme and want each callout to sit on a consistent dark base while still showing its colour clearly, you can use an **overlay effect** like this (add it into the same CSS file):
139+
140+
```css
141+
/* Base background for all callouts */
142+
.callout {
143+
background-color: #282A37 !important; /* Base background */
144+
position: relative;
145+
overflow: hidden;
146+
}
147+
148+
/* Overlay using callout color with opacity */
149+
.callout::before {
150+
content: "";
151+
position: absolute;
152+
inset: 0;
153+
background-color: rgb(var(--callout-color), 0.3); /* Top color overlay */
154+
pointer-events: none;
155+
z-index: 0;
156+
border-radius: var(--radius-s);
157+
}
158+
159+
/* Ensure content stays above the overlay */
160+
.callout > * {
161+
position: relative;
162+
z-index: 1;
163+
}
164+
```
165+
166+
This ensures each callout has a consistent dark base, while the `--callout-color` overlays with controlled transparency. Here the base background colour is the default colour of my Obsidian theme, but you can change it to whatever suits your theme.
167+
168+
This is especially helpful when **nesting** callouts (see below), as it prevents the background of one from bleeding into another.
169+
170+
---
171+
172+
## Nesting Callouts
173+
174+
Yes, you **can nest callouts**, and they’ll render beautifully, especially if you use the background layering technique above.
175+
176+
```markdown
177+
> [!question] Can callouts be nested?
178+
> > [!todo] Yes, they can.
179+
> > > [!example] You can even use multiple layers of nesting.
180+
```
181+
182+
This will render as:
183+
184+
![Nested callouts in Obsidian](../../img/blogs/obsidian-callouts/fig5.png)
185+
186+
Each level keeps its own style, icon, and background overlay, making complex structures more readable.
187+
115188
## Useful Links
116189

117190
* [πŸ“˜ Obsidian Callouts Documentation](https://help.obsidian.md/Editing+and+formatting/Callouts)
118191
* [🎨 Lucide Icon Library](https://lucide.dev/)
119192

120193
---
121194

122-
## πŸ§ͺ Final Tips
195+
## Final Tips
123196

124197
* You can define as many custom callouts as you like, one for each purpose.
125-
* Keep your styles readable by using soft background `rgba` values.
198+
* Keep your styles readable by using soft background `rgba` values or stick to the consistent colours of your theme.
126199
* Consider matching your callouts to your Obsidian theme for a cohesive look.
127-
* You can even use transparent or darkened backgrounds to create layered effects.
200+
* You can also use custom icons from the [Lucide Icon Library](https://lucide.dev/) to make your callouts more visually appealing.
8.83 KB
Loading
10.2 KB
Loading

0 commit comments

Comments
Β (0)