From 44f4c312be3bd70f0d267f5cf340335d68c18200 Mon Sep 17 00:00:00 2001 From: Alexander Dunkel Date: Wed, 29 Apr 2020 09:29:53 +0200 Subject: [PATCH 1/3] feat: admonition shortcodes for note, tip and warning --- assets/scss/_admonition.scss | 45 ++++++++++++++++++++++++++++ assets/scss/_predefined.scss | 3 ++ assets/scss/style.scss | 1 + layouts/partials/svg/exclamation.svg | 1 + layouts/partials/svg/lightbulb.svg | 1 + layouts/partials/svg/sticky-note.svg | 1 + layouts/shortcodes/note.html | 12 ++++++++ layouts/shortcodes/tip.html | 11 +++++++ layouts/shortcodes/warning.html | 11 +++++++ 9 files changed, 86 insertions(+) create mode 100644 assets/scss/_admonition.scss create mode 100644 layouts/partials/svg/exclamation.svg create mode 100644 layouts/partials/svg/lightbulb.svg create mode 100644 layouts/partials/svg/sticky-note.svg create mode 100644 layouts/shortcodes/note.html create mode 100644 layouts/shortcodes/tip.html create mode 100644 layouts/shortcodes/warning.html diff --git a/assets/scss/_admonition.scss b/assets/scss/_admonition.scss new file mode 100644 index 00000000..2721e62e --- /dev/null +++ b/assets/scss/_admonition.scss @@ -0,0 +1,45 @@ +/*admonition styles */ + +.admonition-icon { + fill: $text; + width: 20px; + margin: 6px; + margin-left: -27px; + position: absolute; + top: 10px; + } + + +.note { + border-left-width: 35px; + border-left-style: solid; + position: relative; + border-color: $admonition-note; + display: block; +} + +.warning { + border-left-width: 35px; + border-left-style: solid; + position: relative; + border-color: $admonition-warning; + display: block; +} + +.tip { + border-left-width: 35px; + border-left-style: solid; + position: relative; + border-color: $admonition-tip; + display: block; +} + +.admonition-content { + display: block; + margin: 0px; + padding: .125em 1em; + margin-top: 2em; + margin-bottom: 2em; + overflow-x: auto; + background-color: $highlight-grey; +} \ No newline at end of file diff --git a/assets/scss/_predefined.scss b/assets/scss/_predefined.scss index 7d87c02f..e92c4877 100644 --- a/assets/scss/_predefined.scss +++ b/assets/scss/_predefined.scss @@ -6,6 +6,9 @@ $light-grey: #494f5c; $dark-grey: #3B3E48; $highlight-grey: #7d828a; $midnightblue: #2c3e50; +$admonition-note :#F8E45C; +$admonition-tip : #0594CB; +$admonition-warning :#ff725c; // Fonts // diff --git a/assets/scss/style.scss b/assets/scss/style.scss index 09ee3bb6..b08a28a4 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -2,6 +2,7 @@ @import "normalize.scss"; @import "syntax.scss"; @import "animate.scss"; +@import "admonition.scss"; /* Webkit Scrollbar Customize */ ::-webkit-scrollbar { diff --git a/layouts/partials/svg/exclamation.svg b/layouts/partials/svg/exclamation.svg new file mode 100644 index 00000000..89ef11a7 --- /dev/null +++ b/layouts/partials/svg/exclamation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/layouts/partials/svg/lightbulb.svg b/layouts/partials/svg/lightbulb.svg new file mode 100644 index 00000000..b5d654ba --- /dev/null +++ b/layouts/partials/svg/lightbulb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/layouts/partials/svg/sticky-note.svg b/layouts/partials/svg/sticky-note.svg new file mode 100644 index 00000000..4b577b88 --- /dev/null +++ b/layouts/partials/svg/sticky-note.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/layouts/shortcodes/note.html b/layouts/shortcodes/note.html new file mode 100644 index 00000000..c4100075 --- /dev/null +++ b/layouts/shortcodes/note.html @@ -0,0 +1,12 @@ +{{ $_hugo_config := `{ "version": 1 }` }} + + \ No newline at end of file diff --git a/layouts/shortcodes/tip.html b/layouts/shortcodes/tip.html new file mode 100644 index 00000000..15ad7d0f --- /dev/null +++ b/layouts/shortcodes/tip.html @@ -0,0 +1,11 @@ +{{ $_hugo_config := `{ "version": 1 }` }} + \ No newline at end of file diff --git a/layouts/shortcodes/warning.html b/layouts/shortcodes/warning.html new file mode 100644 index 00000000..13130667 --- /dev/null +++ b/layouts/shortcodes/warning.html @@ -0,0 +1,11 @@ +{{ $_hugo_config := `{ "version": 1 }` }} + \ No newline at end of file From 37ee02a5390958a45bc9814951171554e105d1f3 Mon Sep 17 00:00:00 2001 From: Alexander Dunkel Date: Wed, 29 Apr 2020 09:48:17 +0200 Subject: [PATCH 2/3] Clean up styles, use blue for all admonition highlights --- assets/scss/_admonition.scss | 21 ++------------------- assets/scss/_predefined.scss | 4 +--- layouts/shortcodes/note.html | 4 +--- layouts/shortcodes/tip.html | 5 ++--- layouts/shortcodes/warning.html | 5 ++--- 5 files changed, 8 insertions(+), 31 deletions(-) diff --git a/assets/scss/_admonition.scss b/assets/scss/_admonition.scss index 2721e62e..b6adfe9a 100644 --- a/assets/scss/_admonition.scss +++ b/assets/scss/_admonition.scss @@ -9,28 +9,11 @@ top: 10px; } - -.note { - border-left-width: 35px; - border-left-style: solid; - position: relative; - border-color: $admonition-note; - display: block; -} - -.warning { - border-left-width: 35px; - border-left-style: solid; - position: relative; - border-color: $admonition-warning; - display: block; -} - -.tip { +.admonition-highlight { border-left-width: 35px; border-left-style: solid; position: relative; - border-color: $admonition-tip; + border-color: $admonition-highlight; display: block; } diff --git a/assets/scss/_predefined.scss b/assets/scss/_predefined.scss index e92c4877..78e0938a 100644 --- a/assets/scss/_predefined.scss +++ b/assets/scss/_predefined.scss @@ -6,9 +6,7 @@ $light-grey: #494f5c; $dark-grey: #3B3E48; $highlight-grey: #7d828a; $midnightblue: #2c3e50; -$admonition-note :#F8E45C; -$admonition-tip : #0594CB; -$admonition-warning :#ff725c; +$admonition-highlight : #0594CB; // Fonts // diff --git a/layouts/shortcodes/note.html b/layouts/shortcodes/note.html index c4100075..e50fec89 100644 --- a/layouts/shortcodes/note.html +++ b/layouts/shortcodes/note.html @@ -1,8 +1,6 @@ {{ $_hugo_config := `{ "version": 1 }` }} -