refactor: reduce layout style overrides

This commit is contained in:
Erzbir
2026-08-17 01:36:51 +08:00
parent dda9a2645c
commit 6771c2a90d
7 changed files with 41 additions and 84 deletions
+2 -2
View File
@@ -56,7 +56,7 @@
&-logo {
width: 100%;
max-width: 100% !important;
max-width: 100%;
height: 100%;
object-fit: cover;
display: block;
@@ -157,7 +157,7 @@
img {
width: 140px;
max-width: none !important;
max-width: none;
height: 40px;
margin: 0;
padding: 0;
+15 -40
View File
@@ -40,7 +40,7 @@ html[system_font_enable='true']:not([pixel_style='true']) {
}
* {
scrollbar-width: var(--width-theme-scrollbar) !important;
scrollbar-width: var(--width-theme-scrollbar);
scrollbar-color: var(--color-theme-scrollbar);
font-variant-ligatures: var(--lig-theme-font);
}
@@ -70,45 +70,29 @@ body {
}
}
.wrapper {
display: flex;
flex-direction: row;
}
.sidebar-left,
.sidebar-right {
width: 20%;
padding: calc(var(--size-theme-font) * 1.25);
}
.container {
.site-shell {
display: flex;
flex-direction: column;
padding: var(--spacing-theme-container-padding);
min-height: 100vh;
}
.site-frame {
flex: 1 0 auto;
width: 60%;
padding: var(--spacing-theme-container-padding);
margin: 0 auto;
}
.content {
display: flex;
flex-direction: column;
min-width: 0;
}
body[layout_mode='fullscreen'] {
.wrapper {
display: block;
}
.sidebar-left,
.sidebar-right {
display: none;
width: 0;
padding: 0;
}
.container {
body[data-layout-mode='fullscreen'] {
.site-frame {
width: 100%;
max-width: none !important;
max-width: none;
}
.content img,
@@ -120,34 +104,25 @@ body[layout_mode='fullscreen'] {
}
}
body[table_full_width='true'] {
body[data-table-full-width='true'] {
.content table {
width: 100%;
}
}
@media (max-width: 1024px) {
.sidebar-left,
.sidebar-right {
display: none;
}
.container {
.site-frame {
width: 100%;
}
}
@media (max-width: 768px) {
.container {
.site-frame {
padding: var(--spacing-theme-container-padding-mobile);
}
}
@media print {
.container {
display: initial;
}
.content {
display: initial;
}
+4 -8
View File
@@ -68,10 +68,6 @@
}
}
.spacer {
flex-grow: 1 !important;
}
.menu {
display: flex;
position: relative;
@@ -93,8 +89,8 @@
.menu-trigger {
all: unset;
cursor: pointer;
background-color: var(--color-theme-background) !important;
margin-right: 0 !important;
background-color: var(--color-theme-background);
margin-right: 0;
padding-left: calc(var(--size-theme-font) * 0.3125);
padding-right: calc(var(--size-theme-font) * 0.3125);
color: var(--color-theme-menu);
@@ -105,7 +101,7 @@
@media (max-width: $phone-max-width) {
padding-left: calc(var(--size-theme-font) * 0.625);
padding-right: calc(var(--size-theme-font) * 0.625);
margin-bottom: 0 !important;
margin-bottom: 0;
outline: none;
-webkit-tap-highlight-color: transparent;
}
@@ -146,7 +142,7 @@
.sub-menu:hover .menu-dropdown,
.sub-menu:active .menu-dropdown {
display: flex !important;
display: flex;
opacity: 1;
visibility: visible;
}
+2 -2
View File
@@ -48,8 +48,8 @@
.portfolio-item .post-title {
font-size: calc(var(--size-theme-font) * 1.05);
margin-bottom: calc(var(--size-theme-font) * 0.5) !important;
padding-bottom: calc(var(--size-theme-font) * 0.5) !important;
margin-bottom: calc(var(--size-theme-font) * 0.5);
padding-bottom: calc(var(--size-theme-font) * 0.5);
}
.portfolio-item .post-meta {
+4 -8
View File
@@ -43,10 +43,10 @@
.post-title {
position: relative;
color: var(--color-theme-title);
margin-top: 0 !important;
margin-bottom: calc(var(--size-theme-font) * 0.9375) !important;
padding-bottom: calc(var(--size-theme-font) * 0.9375) !important;
text-decoration: none !important;
margin-top: 0;
margin-bottom: calc(var(--size-theme-font) * 0.9375);
padding-bottom: calc(var(--size-theme-font) * 0.9375);
text-decoration: none;
font-weight: 400;
}
@@ -84,10 +84,6 @@
color: inherit;
}
.post-author {
}
.post-tags {
margin-bottom: calc(var(--size-theme-font) * 0.3125);
font-size: inherit;
+1 -1
View File
@@ -113,7 +113,7 @@
}
}
body[layout_mode='fullscreen'] {
body[data-layout-mode='fullscreen'] {
.toc.toc-visible {
border: calc(var(--size-theme-font) * 0.0625) solid var(--color-theme-foreground);
}
+12 -22
View File
@@ -114,30 +114,20 @@
</th:block>
</head>
<body th:attr="layout_mode=${theme.config.style.fullscreen_layout ? 'fullscreen' : 'normal'},
table_full_width=${theme.config.style.table_full_width ? 'true' : 'false'}">
<div class="page">
<header role="banner">
<div id="header-slot" aria-hidden="true"></div>
</header>
<div class="wrapper">
<aside class="sidebar-left">
</aside>
<main class="container" role="main" th:attr="style=${#strings.isEmpty(theme.config.style.max_width) ? '' : 'max-width:' + theme.config.style.max_width}">
<header class="header">
<th:block th:replace="~{modules/header :: header(isHome = true)}"/>
</header>
<div class="content">
<th:block th:replace="${content}"/>
</div>
<body th:attr="data-layout-mode=${theme.config.style.fullscreen_layout ? 'fullscreen' : 'normal'},
data-table-full-width=${theme.config.style.table_full_width ? 'true' : 'false'}">
<div class="site-shell">
<div class="site-frame"
th:attr="style=${theme.config.style.fullscreen_layout or #strings.isEmpty(theme.config.style.max_width) ? '' : 'max-width:' + theme.config.style.max_width}">
<header class="header">
<th:block th:replace="~{modules/header :: header}"/>
</header>
<main class="content">
<th:block th:replace="${content}"/>
</main>
<aside class="sidebar-right">
</aside>
</div>
<footer class="footer" role="contentinfo">
<div id="footer-slot-head" aria-hidden="true"></div>
<th:block th:replace="~{modules/footer}"/>
<div id="footer-slot-tail" aria-hidden="true"></div>
<footer class="footer">
<th:block th:replace="~{modules/footer :: footer}"/>
</footer>
</div>
</body>