From e59e04f654cd80e5250e68a5c84f563b1c76716a Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 15 Feb 2021 16:15:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=B8=8D=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96code=E4=B8=8Epre=20sivan/heti#46?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/_base.scss | 54 +++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/lib/_base.scss b/lib/_base.scss index 636687f..1b2524f 100644 --- a/lib/_base.scss +++ b/lib/_base.scss @@ -73,33 +73,37 @@ } } - pre { - margin-block-start: $std-block-unit / 2; - margin-block-end: $std-block-unit / 2; - margin-inline-start: 0; - margin-inline-end: 0; - padding-block-start: $std-block-unit / 2; - padding-block-end: $std-block-unit / 2; - padding-inline-start: $std-inline-unit; - padding-inline-end: $std-inline-unit; - overflow: auto; - font-family: $font-family-mono; - white-space: pre; - word-wrap: normal; - border-radius: 4px; - background-color: hsla(0, 0%, 0%, 0.054); + $format_pre_code: true !default; - @include darkmode-style { - background-color: hsla(0, 0%, 100%, 0.054); - } + @if $format_pre_code { + pre { + margin-block-start: $std-block-unit / 2; + margin-block-end: $std-block-unit / 2; + margin-inline-start: 0; + margin-inline-end: 0; + padding-block-start: $std-block-unit / 2; + padding-block-end: $std-block-unit / 2; + padding-inline-start: $std-inline-unit; + padding-inline-end: $std-inline-unit; + overflow: auto; + font-family: $font-family-mono; + white-space: pre; + word-wrap: normal; + border-radius: 4px; + background-color: hsla(0, 0%, 0%, 0.054); - code { - margin: 0; - padding: 0; - border: 0; - border-radius: 0; - background-color: transparent; - color: inherit; + @include darkmode-style { + background-color: hsla(0, 0%, 100%, 0.054); + } + + code { + margin: 0; + padding: 0; + border: 0; + border-radius: 0; + background-color: transparent; + color: inherit; + } } } }