From 4febf7471debca6e26f7eed211bd062f895d29df Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 8 Aug 2020 15:41:20 +0100 Subject: [PATCH] Improve styling for callouts Update styles for callouts (warning, caution, note); also avoid applying callout-specific styles to general block quotes. --- assets/scss/_custom.scss | 38 ++++++++++++------- layouts/partials/css.html | 2 +- layouts/shortcodes/caution.html | 2 +- .../shortcodes/deprecationfilewarning.html | 2 +- layouts/shortcodes/note.html | 2 +- layouts/shortcodes/warning.html | 2 +- .../css/{callouts.css => feature-states.css} | 21 ---------- 7 files changed, 30 insertions(+), 39 deletions(-) rename static/css/{callouts.css => feature-states.css} (67%) diff --git a/assets/scss/_custom.scss b/assets/scss/_custom.scss index 563d87272f..447cca40c7 100644 --- a/assets/scss/_custom.scss +++ b/assets/scss/_custom.scss @@ -268,22 +268,34 @@ main { // blockquotes and callouts -blockquote { - padding: 0.4rem 0.4rem 0.4rem 1rem !important; -} +.td-content, body { + blockquote.callout { + padding: 0.4rem 0.4rem 0.4rem 1rem; + border: 1px solid #eee; + border-left-width: 0.5em; + background: #fff; + color: #000; + margin-top: 0.5em; + margin-bottom: 0.5em; + } + blockquote.callout { + border-radius: calc(1em/3); + } + .callout.caution { + border-left-color: #f0ad4e; + } -// callouts are contained in static CSS as well. these require override. + .callout.note { + border-left-color: #428bca; + } -.caution { - border-left-color: #f0ad4e !important; -} + .callout.warning { + border-left-color: #d9534f; + } -.note { - border-left-color: #428bca !important; -} - -.warning { - border-left-color: #d9534f !important; + h1:first-of-type + blockquote.callout { + margin-top: 1.5em; + } } .deprecation-warning { diff --git a/layouts/partials/css.html b/layouts/partials/css.html index c28d682e1f..8b4bf37e86 100644 --- a/layouts/partials/css.html +++ b/layouts/partials/css.html @@ -16,7 +16,7 @@ {{- end }} - + {{- if .Site.Params.announcement }} diff --git a/layouts/shortcodes/caution.html b/layouts/shortcodes/caution.html index 2d14447142..82563d8c2c 100644 --- a/layouts/shortcodes/caution.html +++ b/layouts/shortcodes/caution.html @@ -1,3 +1,3 @@ -
+
{{ T "caution" }} {{ trim .Inner " \n" | markdownify }}
diff --git a/layouts/shortcodes/deprecationfilewarning.html b/layouts/shortcodes/deprecationfilewarning.html index 48e2f43c98..71583c4c96 100644 --- a/layouts/shortcodes/deprecationfilewarning.html +++ b/layouts/shortcodes/deprecationfilewarning.html @@ -1,3 +1,3 @@ -
+

{{ T "deprecation_file_warning" }}

{{ .Inner | markdownify }}
diff --git a/layouts/shortcodes/note.html b/layouts/shortcodes/note.html index 1161c2366c..eba93f8b7e 100644 --- a/layouts/shortcodes/note.html +++ b/layouts/shortcodes/note.html @@ -1,3 +1,3 @@ -
+
{{ T "note" }} {{ trim .Inner " \n" | markdownify }}
\ No newline at end of file diff --git a/layouts/shortcodes/warning.html b/layouts/shortcodes/warning.html index ddd5ff197f..a6a5f67abd 100644 --- a/layouts/shortcodes/warning.html +++ b/layouts/shortcodes/warning.html @@ -1,3 +1,3 @@ -
+
{{ T "warning" }} {{ trim .Inner " \n" | markdownify }}
diff --git a/static/css/callouts.css b/static/css/feature-states.css similarity index 67% rename from static/css/callouts.css rename to static/css/feature-states.css index ffc61ed4a5..725cf9e0fc 100644 --- a/static/css/callouts.css +++ b/static/css/feature-states.css @@ -1,24 +1,3 @@ -/* Callouts */ -.caution, .note, .warning { - padding: 20px; - margin: 20px 0; - border: 1px solid #eee; - border-left-width: 5px; - border-radius: 3px; -} - -.caution { - border-left-color: #f0ad4e; -} - -.note { - border-left-color: #428bca; -} - -.warning { - border-left-color: #d9534f; -} - /* Feature States */ .beta, .stable, .alpha, .deprecated {