diff --git a/theme/blog/statics/scripts/footer.js b/theme/blog/statics/scripts/footer.js index 1c4b1788..73c4aa50 100644 --- a/theme/blog/statics/scripts/footer.js +++ b/theme/blog/statics/scripts/footer.js @@ -261,9 +261,7 @@ class __Vim { } }, w: function() { - let elem = document.getElementById('content'); - let maxWidth = elem.style.maxWidth; - elem.style.maxWidth = maxWidth == 'unset' ? 'var(--max-width)' : 'unset'; + document.body.classList.toggle("wide"); }, r: function() { location.reload(); diff --git a/theme/blog/styles/content.scss b/theme/blog/styles/content.scss index f6600157..51e6f42e 100644 --- a/theme/blog/styles/content.scss +++ b/theme/blog/styles/content.scss @@ -1,7 +1,11 @@ /* 内容 */ #content { - max-width: var(--max-width); + max-width: var(--max-width); +} + +body.wide #content { + max-width: unset; } #content { diff --git a/theme/blog/styles/global.scss b/theme/blog/styles/global.scss index 81dff666..53418aea 100644 --- a/theme/blog/styles/global.scss +++ b/theme/blog/styles/global.scss @@ -151,7 +151,7 @@ table { td, th { border: var(--table-border); - padding: 0.4em 0.8em; + padding: 0.2em 0.8em; } &.no-border, &.no-border td { diff --git a/theme/blog/templates/_header.html b/theme/blog/templates/_header.html index 874aedd3..3347290a 100644 --- a/theme/blog/templates/_header.html +++ b/theme/blog/templates/_header.html @@ -17,7 +17,7 @@ {{ render "custom_header" . }} -
+