Fix various spacings in markdown in shartcodes

This commit is contained in:
Alex Shpak 2019-06-12 17:27:46 +02:00
parent c9d979514c
commit 1c3d8491ec
6 changed files with 26 additions and 12 deletions

View file

@ -3,17 +3,18 @@
$block-border-radius: 0.15rem; $block-border-radius: 0.15rem;
.markdown { .markdown {
line-height: 1.7; line-height: 1.6;
h1, h2, h3, h4, h5 { h1, h2, h3, h4, h5 {
font-weight: $body-font-weight; font-weight: normal;
line-height: 1.25; line-height: 1;
margin-top: $padding-16 * 2;
margin-bottom: $padding-8;
} }
// remove padding at the beginning of page // remove padding at the beginning of page
> :first-child { > :first-child {
margin-top: 0; margin-top: 0;
line-height: 1;
} }
b, optgroup, strong { b, optgroup, strong {
@ -42,7 +43,7 @@ $block-border-radius: 0.15rem;
padding: $padding-16; padding: $padding-16;
background: $gray-100; background: $gray-100;
border-radius: $block-border-radius; border-radius: $block-border-radius;
font-size: $font-size-14; font-size: .875em;
overflow-x: auto; overflow-x: auto;
code { code {
@ -53,7 +54,7 @@ $block-border-radius: 0.15rem;
blockquote { blockquote {
border-left: $padding-1*2 solid $gray-300; border-left: $padding-1*2 solid $gray-300;
margin: 0; margin: $padding-16 0;
padding: $padding-1 $padding-16; padding: $padding-1 $padding-16;
:first-child { margin-top: 0; } :first-child { margin-top: 0; }
@ -63,11 +64,13 @@ $block-border-radius: 0.15rem;
table { table {
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;
margin-top: $padding-16;
margin-bottom: $padding-16;
tr th, tr td { tr th, tr td {
padding: $padding-8 $padding-16; padding: $padding-8 $padding-16;
line-height: 1; line-height: 1;
border: 1px solid $gray-200; border: $padding-1 solid $gray-200;
} }
tr:nth-child(2n) { tr:nth-child(2n) {

View file

@ -1,4 +1,4 @@
@import "variables"; @import 'variables';
.markdown-inner { // Util class to remove extra margin in nested markdown content .markdown-inner { // Util class to remove extra margin in nested markdown content
> :first-child { > :first-child {
@ -61,6 +61,10 @@
} }
// {{< columns >}} // {{< columns >}}
.book-columns {
margin-top: $padding-16;
margin-bottom: $padding-16;
}
.book-columns > { .book-columns > {
div { div {
max-width: 50%; max-width: 50%;

View file

@ -1,8 +1,15 @@
// Used in layout
$padding-1: 1px; $padding-1: 1px;
$padding-4: 0.25rem; $padding-4: 0.25rem;
$padding-8: 0.5rem; $padding-8: 0.5rem;
$padding-16: 1rem; $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-base: 16px;
$font-size-12: 0.75rem; $font-size-12: 0.75rem;
$font-size-14: 0.875rem; $font-size-14: 0.875rem;

View file

@ -1,8 +1,8 @@
@import "normalize"; @import "normalize";
@import "variables"; @import "variables";
@import "markdown";
@import "shortcode";
@import "utils"; @import "utils";
@import "markdown";
@import "shortcodes";
html { html {
font-size: $font-size-base; font-size: $font-size-base;

View file

@ -1 +1 @@
{"Target":"book.min.1f05d81b275a862f44a849039ab95c032a03abf4aebe5aeff5367876fc7b68ab.css","MediaType":"text/css","Data":{"Integrity":"sha256-HwXYGydahi9EqEkDmrlcAyoDq/Suvlrv9TZ4dvx7aKs="}} {"Target":"book.min.9b09cbcc634240e8387073e7239dd1343279a4e12f1c81c594d60481ca705d60.css","MediaType":"text/css","Data":{"Integrity":"sha256-mwnLzGNCQOg4cHPnI53RNDJ5pOEvHIHFlNYEgcpwXWA="}}