Skip to content

Commit

Permalink
Add Alert/admonition styling
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Nov 2, 2024
1 parent 8a88d04 commit 9165f95
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 0 deletions.
11 changes: 11 additions & 0 deletions themes/justatheory/layouts/_default/_markup/render-blockquote.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ if eq .Type "alert" }}
<blockquote class="alert alert-{{ .AlertType }}">
<p class="alert-title">{{ with .AlertTitle }}{{ . }}{{ else }}{{ or (i18n .AlertType) (title .AlertType) }}{{ end }}</p>
{{ .Text }}
</blockquote>
{{ else }}
<blockquote>
{{ .Text }}
</blockquote>
{{ end }}

63 changes: 63 additions & 0 deletions themes/justatheory/static/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,69 @@ object.slides {
height: 512px;
}

/* Alert CSS based on GitHub's */
.alert {
border-left: .25em solid currentColor;
padding-top: .5rem;
padding-bottom: .5rem;
}
.alert *:last-child {
margin-bottom: 0;
padding-bottom: 0;
}
.alert-title {
vertical-align: middle;
vertical-align: top;
}
.alert-title:before {
margin-right: .4rem;
}
.alert-note {
border-left-color: rgb(9,105,218)
}
.alert-note .alert-title {
color: rgb(9,105,218);
}
.alert-note .alert-title:before {
content: url('/img/note.svg');
}
.alert-tip {
border-left-color: rgb(63,185,80)
}
.alert-tip .alert-title {
color: rgb(63,185,80);
}
.alert-tip .alert-title:before {
content: url('/img/tip.svg');
}
.alert-important {
border-left-color: rgb(137,87,229)
}
.alert-important .alert-title {
color: rgb(137,87,229);
}
.alert-important .alert-title:before {
content: url('/img/important.svg');
}
.alert-warning {
border-left-color: rgb(158,106,3)
}
.alert-warning .alert-title {
color: rgb(158,106,3);
}
.alert-warning .alert-title:before {
content: url('/img/warning.svg');
}
.alert-caution {
border-left-color: rgb(218,54,51)
}
.alert-caution .alert-title {
color: rgb(218,54,51);
}
.alert-caution .alert-title:before {
content: url('/img/caution.svg');
}

/* content/post/past/web/markup/html-embed-test.md, static/code/testembed.html */
code._testembed{background:green}
object#_testembed{background:lightblue;width:100%;border:1px dotted darkblue}
Expand Down
1 change: 1 addition & 0 deletions themes/justatheory/static/img/caution.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/justatheory/static/img/important.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/justatheory/static/img/note.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/justatheory/static/img/tip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/justatheory/static/img/warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9165f95

Please sign in to comment.