From 188d8ffc69f7f1958b08117d01d918b099845de4 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 15 Aug 2020 00:35:00 +0800 Subject: [PATCH] Resume the min-width of the tables. It was lost by mistake while fixing #85 --- _includes/fixlinenos.html | 12 ------- _includes/refactor-content.html | 27 ++++++++++++++++ _layouts/default.html | 2 +- assets/css/_addon/main.scss | 55 ++++++++++++++++----------------- assets/css/_addon/module.scss | 2 +- 5 files changed, 56 insertions(+), 42 deletions(-) delete mode 100644 _includes/fixlinenos.html create mode 100644 _includes/refactor-content.html diff --git a/_includes/fixlinenos.html b/_includes/fixlinenos.html deleted file mode 100644 index e736923..0000000 --- a/_includes/fixlinenos.html +++ /dev/null @@ -1,12 +0,0 @@ - -{% if include.content contains '
' %} - {% assign content = include.content | replace: '', '' %} - {{ content }} -{% else %} - {{ include.content }} -{% endif %} diff --git a/_includes/refactor-content.html b/_includes/refactor-content.html new file mode 100644 index 0000000..605d24a --- /dev/null +++ b/_includes/refactor-content.html @@ -0,0 +1,27 @@ + + +{% assign _content = include.content %} + + +{% if _content contains '
' %} + {% assign _content = _content | replace: '', '' %} +{% endif %} + +{{ _content }} diff --git a/_layouts/default.html b/_layouts/default.html index 8c78a51..55463c3 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -36,7 +36,7 @@ layout: compress- {% include fixlinenos.html content=content %} + {% include refactor-content.html content=content %} {% include footer.html %} diff --git a/assets/css/_addon/main.scss b/assets/css/_addon/main.scss index 6ce089c..22fa90d 100644 --- a/assets/css/_addon/main.scss +++ b/assets/css/_addon/main.scss @@ -750,42 +750,41 @@ a { /*--- Begin of Markdown table style ---*/ +div.post-content .table-wrapper { + overflow-x: auto; -div.post-content { - >table, li>table { + >table { min-width: 60%; - display: block; overflow-x: auto; - border-collapse: collapse; border-spacing: 0; margin-bottom: 1.5rem; + + thead { + border-bottom: solid 2px rgba(210, 215, 217, 0.75); + th { + @extend %table-cell; + } + } + + tbody { + tr { + &:nth-child(2n) { + background-color: var(--tb-even-bg); + } + &:nth-child(2n + 1) { + background-color: var(--tb-odd-bg); + } + & { + border-bottom: 1px solid var(--tb-border-color); + } + td { + @extend %table-cell; + } + } + } } } -table { - thead { - border-bottom: solid 2px rgba(210, 215, 217, 0.75); - +tbody tr { - &:nth-child(2n) { - background-color: var(--tb-even-bg); - } - &:nth-child(2n + 1) { - background-color: var(--tb-odd-bg); - } - & { - border-bottom: 1px solid var(--tb-border-color); - } - } - th { - @extend %table-cell; - } - } - - tbody td { - @extend %table-cell; - } - -} // table /*--- post ---*/ diff --git a/assets/css/_addon/module.scss b/assets/css/_addon/module.scss index 24d2767..81fc8eb 100644 --- a/assets/css/_addon/module.scss +++ b/assets/css/_addon/module.scss @@ -15,7 +15,7 @@ } %table-cell { - padding: .35rem .8rem; + padding: .4rem 1rem; font-size: 95%; }