From 2cbf7aadd4d3e17086f19f92f4148b29aaadddc2 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 21 Nov 2025 16:24:07 +0800 Subject: [PATCH] feat: add styles to hide empty aside and expand article for better layout on medium screens (#659) --- assets/css/_core/_media.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/assets/css/_core/_media.scss b/assets/css/_core/_media.scss index 5c29f081..6a0f5058 100644 --- a/assets/css/_core/_media.scss +++ b/assets/css/_core/_media.scss @@ -40,6 +40,21 @@ } } +@media only screen and (max-width: 1200px) and (min-width: 961px) { + .wrapper main { + // Hide empty aside and expand article when only one aside is empty + aside:first-child:empty:has(~ aside:not(:empty)), + aside:first-child:not(:empty) ~ aside#toc-auto:empty { + display: none; + } + + aside:first-child:empty:has(~ aside:not(:empty)) ~ article, + aside:first-child:not(:empty) ~ article:has(~ aside:empty) { + flex: 3; + } + } +} + @media only screen and (max-width: 960px) { %page-style { width: ROUND(80%, 2px) !important;