From bc7e541f61e86ff433fc7db62aebecc4dbaef17b Mon Sep 17 00:00:00 2001 From: George Cushen Date: Tue, 15 Jan 2019 18:29:55 +0000 Subject: [PATCH] fix(shortcode): allow for multiple child elements in Alerts Previously, alerts were designed just for a single child consisting of a paragraph. Now supports styling of multiple children including lists. Fix #881 --- layouts/partials/css/academic.css | 14 +++++++++++--- layouts/shortcodes/alert.html | 4 +++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/layouts/partials/css/academic.css b/layouts/partials/css/academic.css index d5c4ed67..c97ff411 100644 --- a/layouts/partials/css/academic.css +++ b/layouts/partials/css/academic.css @@ -1814,7 +1814,7 @@ table > tbody > tr:hover > th { * Alerts **************************************************/ -div.alert p { +div.alert > div { position: relative; display: block; font-size: 1rem; @@ -1823,7 +1823,15 @@ div.alert p { margin-bottom: 0; } -div.alert p:first-child::before { +div.alert div > * { + margin-bottom: .5rem; /* Use smaller paragraph spacing than usual. */ +} + +div.alert div > :last-child { + margin-bottom: 0; +} + +div.alert > div:first-child::before { position: absolute; top: -0.5rem; left: -2rem; @@ -1836,7 +1844,7 @@ div.alert p:first-child::before { text-align: center; } -div.alert-warning p:first-child::before { +div.alert-warning > div:first-child::before { font-family: 'Font Awesome 5 Free'; font-weight: 900; color: #ff3860; diff --git a/layouts/shortcodes/alert.html b/layouts/shortcodes/alert.html index b93b95cf..f509381c 100644 --- a/layouts/shortcodes/alert.html +++ b/layouts/shortcodes/alert.html @@ -1,3 +1,5 @@
- {{ .Inner }} +
+ {{ .Inner }} +