add admonitions and padding

This commit is contained in:
Amolith 2023-05-04 12:39:13 -04:00
parent 07eb0d5358
commit 4206274dc3
Signed by: Amolith
GPG Key ID: 8AE30347CE28D101
2 changed files with 48 additions and 0 deletions

View File

@ -24,6 +24,41 @@ summary:hover {
background-color: #ddd;
border-radius: 7px;
}
.admonition {
margin: 15px -14px;
padding: 5px 10px;
border: 2px solid;
p {
margin: 0;
}
&.note {
border-color: #b3d1f3;
background-color: #e5f1ff;
}
&.tip {
border-color: #b3f3d1;
background-color: #e5fff1;
}
&.warn {
border-color: #f3d1b3;
background-color: #fff0ce;
}
&.err {
border-color: #f3b3b3;
background-color: #ffe5e5;
}
}
blockquote {
margin: 15px -19px;
padding: 0 15px;
border-left: 3px solid $dark;
border-radius: 7px;
color: $dark;
p {
margin: 0;
}
}
hr {
margin: 15px 0;
border: 1px solid $dark;

View File

@ -0,0 +1,13 @@
{{- if .IsNamedParams }}
{{- if eq (.Get "type") "note" "warn" "err" "tip" }}
<aside class="admonition {{ .Get "type" }}">
<p>{{- .Inner | markdownify -}}</p>
</aside>
{{- else }}
{{ errorf "param 'type' must be one of note, warn, or err: %s" .Position }}
{{- end }}
{{- else }}
<aside class="admonition note">
<p>{{- .Inner | markdownify -}}</p>
</aside>
{{- end }}