From 11b2fe753b762e4f226f948bd670cb179f73cb08 Mon Sep 17 00:00:00 2001 From: Clarmy Lee Date: Sun, 24 Nov 2024 14:58:09 +0800 Subject: [PATCH] chore: Update _syntax.scss to center code block and set maximum width --- _sass/klise/_syntax.scss | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_sass/klise/_syntax.scss b/_sass/klise/_syntax.scss index ccad7af60..72fb29908 100644 --- a/_sass/klise/_syntax.scss +++ b/_sass/klise/_syntax.scss @@ -22,9 +22,10 @@ code { // Codeblock Theme pre.highlight, pre { - margin: 0 -27px; + margin: 0 auto; // Center the code block + max-width: 100%; // Set the maximum width of the code block to 100% of the parent container @include media-query($on-mobile) { - margin: 0 calc(51% - 51vw); + margin: 0 auto; // Center on mobile devices as well padding-left: 20px; } border: 1px solid rgba(128,128,128,0.1); @@ -36,7 +37,7 @@ pre.highlight, pre { > code { width: 100%; - max-width: 50rem; + max-width: 100%; // Ensure the width of the code element does not exceed the pre element margin-left: auto; margin-right: auto; line-height: 1.5;