From 1c3d8491ec10b0eb790797c191f7df7dc484c618 Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Wed, 12 Jun 2019 17:27:46 +0200 Subject: Fix various spacings in markdown in shartcodes --- assets/_markdown.scss | 17 ++++++---- assets/_shortcode.scss | 84 ---------------------------------------------- assets/_shortcodes.scss | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ assets/_variables.scss | 7 ++++ assets/book.scss | 4 +-- 5 files changed, 107 insertions(+), 93 deletions(-) delete mode 100644 assets/_shortcode.scss create mode 100644 assets/_shortcodes.scss (limited to 'assets') diff --git a/assets/_markdown.scss b/assets/_markdown.scss index d52dddb..3814028 100644 --- a/assets/_markdown.scss +++ b/assets/_markdown.scss @@ -3,17 +3,18 @@ $block-border-radius: 0.15rem; .markdown { - line-height: 1.7; + line-height: 1.6; h1, h2, h3, h4, h5 { - font-weight: $body-font-weight; - line-height: 1.25; + font-weight: normal; + line-height: 1; + margin-top: $padding-16 * 2; + margin-bottom: $padding-8; } // remove padding at the beginning of page > :first-child { margin-top: 0; - line-height: 1; } b, optgroup, strong { @@ -42,7 +43,7 @@ $block-border-radius: 0.15rem; padding: $padding-16; background: $gray-100; border-radius: $block-border-radius; - font-size: $font-size-14; + font-size: .875em; overflow-x: auto; code { @@ -53,7 +54,7 @@ $block-border-radius: 0.15rem; blockquote { border-left: $padding-1*2 solid $gray-300; - margin: 0; + margin: $padding-16 0; padding: $padding-1 $padding-16; :first-child { margin-top: 0; } @@ -63,11 +64,13 @@ $block-border-radius: 0.15rem; table { border-spacing: 0; border-collapse: collapse; + margin-top: $padding-16; + margin-bottom: $padding-16; tr th, tr td { padding: $padding-8 $padding-16; line-height: 1; - border: 1px solid $gray-200; + border: $padding-1 solid $gray-200; } tr:nth-child(2n) { diff --git a/assets/_shortcode.scss b/assets/_shortcode.scss deleted file mode 100644 index 0417ae7..0000000 --- a/assets/_shortcode.scss +++ /dev/null @@ -1,84 +0,0 @@ -@import "variables"; - -.markdown-inner { // Util class to remove extra margin in nested markdown content - > :first-child { - margin-top: 0; - } - > :last-child { - margin-bottom: 0; - } -} - -// {{< expand "Label" "icon" >}} -.book-expand { - border: 1px solid $gray-200; - margin-top: $padding-16; - margin-bottom: $padding-16; - - .book-expand-head { - background: $gray-100; - padding: $padding-8 $padding-16; - cursor: pointer; - } - - .book-expand-content { - display: none; - padding: $padding-16; - } - - input[type="checkbox"]:checked + .book-expand-content { - display: block; - } -} - -// {{< tabs >}} -.book-tabs { - border: 1px solid $gray-200; - display: flex; - flex-wrap: wrap; - - label { - display: inline-block; - padding: $padding-8 $padding-16; - border-bottom: $padding-1 transparent; - cursor: pointer; - } - - .book-tabs-content { - order: 999; //Move content blocks to the end - width: 100%; - border-top: $padding-1 solid $gray-100; - padding: $padding-16; - display: none; - } - - input[type="radio"]:checked + label { - border-bottom: $padding-1 solid $color-link; - } - input[type="radio"]:checked + label + .book-tabs-content { - display: block; - } -} - -// {{< columns >}} -.book-columns > { - div { - max-width: 50%; - } - div + div { - margin-left: $padding-16 * 2; - } -} - -// {{< button >}} -a.book-btn { - display: inline-block; - color: $color-link !important; - text-decoration: none !important; - border: $padding-1 solid $color-link; - border-radius: $padding-4; - padding: $padding-4 $padding-16; - margin-top: $padding-8; - margin-bottom: $padding-8; - cursor: pointer; -} diff --git a/assets/_shortcodes.scss b/assets/_shortcodes.scss new file mode 100644 index 0000000..2ec5712 --- /dev/null +++ b/assets/_shortcodes.scss @@ -0,0 +1,88 @@ +@import 'variables'; + +.markdown-inner { // Util class to remove extra margin in nested markdown content + > :first-child { + margin-top: 0; + } + > :last-child { + margin-bottom: 0; + } +} + +// {{< expand "Label" "icon" >}} +.book-expand { + border: 1px solid $gray-200; + margin-top: $padding-16; + margin-bottom: $padding-16; + + .book-expand-head { + background: $gray-100; + padding: $padding-8 $padding-16; + cursor: pointer; + } + + .book-expand-content { + display: none; + padding: $padding-16; + } + + input[type="checkbox"]:checked + .book-expand-content { + display: block; + } +} + +// {{< tabs >}} +.book-tabs { + border: 1px solid $gray-200; + display: flex; + flex-wrap: wrap; + + label { + display: inline-block; + padding: $padding-8 $padding-16; + border-bottom: $padding-1 transparent; + cursor: pointer; + } + + .book-tabs-content { + order: 999; //Move content blocks to the end + width: 100%; + border-top: $padding-1 solid $gray-100; + padding: $padding-16; + display: none; + } + + input[type="radio"]:checked + label { + border-bottom: $padding-1 solid $color-link; + } + input[type="radio"]:checked + label + .book-tabs-content { + display: block; + } +} + +// {{< columns >}} +.book-columns { + margin-top: $padding-16; + margin-bottom: $padding-16; +} +.book-columns > { + div { + max-width: 50%; + } + div + div { + margin-left: $padding-16 * 2; + } +} + +// {{< button >}} +a.book-btn { + display: inline-block; + color: $color-link !important; + text-decoration: none !important; + border: $padding-1 solid $color-link; + border-radius: $padding-4; + padding: $padding-4 $padding-16; + margin-top: $padding-8; + margin-bottom: $padding-8; + cursor: pointer; +} diff --git a/assets/_variables.scss b/assets/_variables.scss index 68d1099..5fbd04c 100644 --- a/assets/_variables.scss +++ b/assets/_variables.scss @@ -1,8 +1,15 @@ +// Used in layout $padding-1: 1px; $padding-4: 0.25rem; $padding-8: 0.5rem; $padding-16: 1rem; +// Used in markdown and shortcodes +$padding-em-1: 1px; +$padding-em-4: .25em; +$padding-em-8: .5em; +$padding-em-16: 1em; + $font-size-base: 16px; $font-size-12: 0.75rem; $font-size-14: 0.875rem; diff --git a/assets/book.scss b/assets/book.scss index 835395a..7be66a6 100644 --- a/assets/book.scss +++ b/assets/book.scss @@ -1,8 +1,8 @@ @import "normalize"; @import "variables"; -@import "markdown"; -@import "shortcode"; @import "utils"; +@import "markdown"; +@import "shortcodes"; html { font-size: $font-size-base; -- cgit v1.2.3