Skip to content

Commit e6c7c35

Browse files
committed
obsidian callouts
1 parent 93987a1 commit e6c7c35

File tree

1 file changed

+69
-17
lines changed

1 file changed

+69
-17
lines changed

content/blog-posts/2025-06-17-making-callouts-obsidian.ipynb

Lines changed: 69 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
"\n",
1616
"---\n",
1717
"\n",
18-
"## Step 1: Enable Custom CSS Snippets\n",
18+
"## Steps Overview\n",
19+
"\n",
20+
"The following steps will guide you through creating custom callouts in Obsidian:\n",
21+
"\n",
22+
"### Step 1: Enable Custom CSS Snippets\n",
1923
"\n",
2024
"Before we begin, make sure you’ve enabled CSS snippets in Obsidian:\n",
2125
"\n",
@@ -27,7 +31,7 @@
2731
"\n",
2832
"---\n",
2933
"\n",
30-
"## Step 2: Define a Custom Callout Block in the css file\n",
34+
"### Step 2: Define a Custom Callout Block in the css file\n",
3135
"\n",
3236
"Here’s an example of a custom callout called `figure` with a pink theme and a pencil icon:\n",
3337
"\n",
@@ -55,7 +59,7 @@
5559
"\n",
5660
"---\n",
5761
"\n",
58-
"## Customise Labels, Icons & Colors\n",
62+
"### Step 3: Customise Labels, Icons & Colours\n",
5963
"\n",
6064
"You can define any name for your callout, it can be `[!theorem]`, `[!tip]`, `[!poetry]`, or whatever suits your workflow. Each one can be styled uniquely by modifying:\n",
6165
"\n",
@@ -119,7 +123,60 @@
119123
"\n",
120124
"---\n",
121125
"\n",
122-
"## Foldable Callouts\n",
126+
"### Step 4: Using Theme Variables for Consistent Colours\n",
127+
"\n",
128+
"If you want to keep your callout colours consistent with your Obsidian theme, or you just want an easy way to update your colour scheme in one place, you can define custom colour variables using the `:root` selector at the top of your CSS file.\n",
129+
"\n",
130+
"Here’s an example using a Dracula-inspired palette:\n",
131+
"\n",
132+
"```css\n",
133+
":root {\n",
134+
" /* Dracula base palette */\n",
135+
" --drac-bg: #282A37;\n",
136+
" --drac-pink-rgb: 255, 121, 198;\n",
137+
" --drac-cyan-rgb: 132, 222, 240;\n",
138+
" --drac-purple-rgb: 189, 147, 249;\n",
139+
" --drac-green-rgb: 80, 250, 123;\n",
140+
" --drac-yellow-rgb: 241, 250, 140;\n",
141+
" --drac-red-rgb: 255, 85, 85;\n",
142+
"}\n",
143+
"```\n",
144+
"\n",
145+
"Then, reference these variables when creating your callouts:\n",
146+
"\n",
147+
"```css\n",
148+
".callout[data-callout=\"question\"] {\n",
149+
" --callout-color: var(--drac-pink-rgb);\n",
150+
" --callout-icon: lucide-help-circle;\n",
151+
" background-color: rgba(var(--drac-pink-rgb), 0.2);\n",
152+
"}\n",
153+
"```\n",
154+
"\n",
155+
"This approach keeps your CSS more readable and maintainable, and allows you to easily **change the colour scheme for all your callouts at once** by editing the `:root` variables.\n",
156+
"\n",
157+
"For example, your `theorem` callout could use the purple variable:\n",
158+
"\n",
159+
"```css\n",
160+
".callout[data-callout=\"theorem\"] {\n",
161+
" --callout-color: var(--drac-purple-rgb);\n",
162+
" --callout-icon: lucide-square-sigma;\n",
163+
" background-color: rgba(var(--drac-purple-rgb), 0.2);\n",
164+
"}\n",
165+
"```\n",
166+
"\n",
167+
"And your `warning` set could use:\n",
168+
"\n",
169+
"```css\n",
170+
".callout[data-callout=\"warning\"] {\n",
171+
" --callout-color: var(--drac-yellow-rgb);\n",
172+
" --callout-icon: lucide-alert-triangle;\n",
173+
" background-color: rgba(var(--drac-yellow-rgb), 0.2);\n",
174+
"}\n",
175+
"```\n",
176+
"\n",
177+
"## Helpful Tips\n",
178+
"\n",
179+
"### Foldable Callouts\n",
123180
"\n",
124181
"You can make callouts foldable by adding `+` or `-` after the label:\n",
125182
"\n",
@@ -140,7 +197,7 @@
140197
"\n",
141198
"---\n",
142199
"\n",
143-
"## Creating a Colour Overlay on a Dark Base\n",
200+
"### Creating a Colour Overlay on a Dark Base\n",
144201
"\n",
145202
"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):\n",
146203
"\n",
@@ -176,7 +233,7 @@
176233
"\n",
177234
"---\n",
178235
"\n",
179-
"## Nesting Callouts\n",
236+
"### Nesting Callouts\n",
180237
"\n",
181238
"Yes, you **can nest callouts**, and they’ll render beautifully, especially if you use the background layering technique above.\n",
182239
"\n",
@@ -192,19 +249,14 @@
192249
"\n",
193250
"Each level keeps its own style, icon, and background overlay, making complex structures more readable.\n",
194251
"\n",
195-
"## Useful Links\n",
196-
"\n",
197-
"* [📘 Obsidian Callouts Documentation](https://help.obsidian.md/Editing+and+formatting/Callouts)\n",
198-
"* [🎨 Lucide Icon Library](https://lucide.dev/)\n",
199-
"\n",
200-
"---\n",
201-
"\n",
202252
"## Final Tips\n",
203253
"\n",
204-
"* You can define as many custom callouts as you like, one for each purpose.\n",
205-
"* Keep your styles readable by using soft background `rgba` values or stick to the consistent colours of your theme.\n",
206-
"* Consider matching your callouts to your Obsidian theme for a cohesive look.\n",
207-
"* You can also use custom icons from the [Lucide Icon Library](https://lucide.dev/) to make your callouts more visually appealing.\n"
254+
"* Define custom callout names that suit your workflow, like `note`, `figure`, `equation`, `bug`, or `reminder`.\n",
255+
"* Use `:root` variables to keep your colors consistent across different callouts and future-proof your CSS.\n",
256+
"* Match your callouts to your Obsidian theme for a more cohesive visual experience.\n",
257+
"* Use icons from [Lucide](https://lucide.dev/) to make each callout instantly recognizable.\n",
258+
"* Experiment with different background opacities to find the right balance for readability.\n",
259+
"* Consider using foldable callouts to keep your notes tidy and focused.\n"
208260
]
209261
},
210262
{

0 commit comments

Comments
 (0)