Skip to content

Commit

Permalink
feat(jannis-baum#141): handle unconfigured custom marker same as Obsi…
Browse files Browse the repository at this point in the history
…dian

On Obsidian, if a custom marker is not defined

e.g.

> [!fooooobarrrrr]

It's styled the same as [!NOTE] (icon and color)

Thanks @Tweekism for confirming
  • Loading branch information
tuurep committed Nov 10, 2024
1 parent 9e6350d commit ed16ae5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 0 additions & 4 deletions static/colors.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
--alert-warning: #ffaf00;
--alert-caution: #ff5f5f;

--alert-custom-default: #c0c0c0;

--ipynb-bg-error: rgba(255, 0, 0, 0.1);
}

Expand Down Expand Up @@ -99,8 +97,6 @@
--alert-warning: #bf8700;
--alert-caution: #cf222e;

--alert-custom-default: #404040;

--ipynb-bg-error: rgba(255, 0, 0, 0.1);
}
}
6 changes: 3 additions & 3 deletions static/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ blockquote {
vertical-align: text-bottom;
fill: currentColor;
}
/* default style for custom markers (Obsidian Callout style) */
/* default style for unconfigured custom markers (Obsidian Callout style) */
.markdown-alert {
border-left: .25rem solid var(--alert-custom-default);
border-left: .25rem solid var(--alert-note);
}
.markdown-alert .markdown-alert-title {
color: var(--alert-custom-default);
color: var(--alert-note);
}
/* default styles for GitHub style markers */
.markdown-alert-note {
Expand Down
8 changes: 5 additions & 3 deletions tests/rendering/markdown-additional.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ This paragraph has a red background color.{style=background-color:red}
### With a custom title

> [!NOTE] Foo bar
> 'Note' with a custom title
> [!TIP] Foo bar
> 'Tip' with a custom title
### Using custom markers ([Obsidian Callout](https://help.obsidian.md/Editing+and+formatting/Callouts) style)

> [!CUSTOM]
> Something more special
> Set custom icon and color for any marker
>
> If unconfigured, it's styled like 'Note'
> [!fOoBaR]
> The marker is case-insensitive and turns into Title Case
Expand Down

0 comments on commit ed16ae5

Please sign in to comment.