style: refactor layout and replace fixed spacing with font-relative units

This commit is contained in:
Erzbir
2025-08-05 14:50:52 +08:00
parent 8e3cd1ae8d
commit 6e0c6973f2
15 changed files with 287 additions and 233 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ a.button {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 8px 18px;
padding: calc(var(--font-theme-size) * 0.5) calc(var(--font-theme-size) * 1.125);
text-decoration: none;
text-align: center;
font: inherit;
@@ -26,7 +26,7 @@ button.outline,
a.button.outline {
background: transparent;
box-shadow: none;
padding: 8px 18px;
padding: calc(var(--font-theme-size) * 0.5) calc(var(--font-theme-size) * 1.125);
}
button.outline :hover,
@@ -52,8 +52,8 @@ a.button.small {
button.wide,
.button.wide,
a.button.wide {
min-width: 200px;
padding: 14px 24px;
min-width: calc(var(--font-theme-size) * 12.5);
padding: calc(var(--font-theme-size) * 0.875) calc(var(--font-theme-size) * 1.5);
}
a.button.inline {
+4 -2
View File
@@ -1,6 +1,8 @@
comment-widget {
--halo-comment-widget-base-font-family: var(--font-theme-default) !important;
--halo-comment-widget-base-border-radius: 0 !important;
--halo-comment-widget-base-border-radius: var(--radius-theme-default) !important;
--halo-comment-widget-base-font-size: var(--font-theme-size) !important;
--halo-comment-widget-base-line-height: var(--line-theme-height) !important;
--halo-comment-widget-base-color: var(--color-theme-foreground) !important;
--halo-comment-widget-base-info-color: var(--color-theme-foreground) !important;
--halo-comment-widget-component-form-input-bg-color: var(--color-theme-background) !important;
@@ -30,5 +32,5 @@ comment-widget {
}
.comment {
margin-top: 40px;
margin-top: calc(var(--font-theme-size) * 2.5);
}
+17 -16
View File
@@ -1,10 +1,11 @@
@import "variables";
.footer {
padding: 40px 0;
padding: calc(var(--font-theme-size) * 1.25) 0;
flex-grow: 0;
opacity: 0.65;
position: relative;
margin-top: auto;
z-index: -1;
}
@@ -13,10 +14,10 @@
flex-direction: column;
align-items: center;
text-align: center;
padding: 20px;
max-width: 1200px;
padding: calc(var(--font-theme-size) * 1.25);
max-width: calc(var(--font-theme-size) * 75);
margin: 0 auto;
gap: 12px;
gap: calc(var(--font-theme-size) * 0.75);
a {
color: inherit;
@@ -28,7 +29,7 @@
flex-wrap: wrap;
justify-content: center;
align-items: center;
font-size: 0.9rem;
font-size: calc(var(--font-theme-size) * 0.9);
line-height: 1.5;
}
@@ -42,9 +43,9 @@
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
gap: calc(var(--font-theme-size) * 0.625);
flex-wrap: wrap;
font-size: 0.9rem;
font-size: calc(var(--font-theme-size) * 0.9);
line-height: 1.5;
}
@@ -58,42 +59,42 @@
margin: 0;
display: flex;
align-items: center;
gap: 10px;
gap: calc(var(--font-theme-size) * 0.625);
flex-wrap: wrap;
justify-content: center;
}
@media (max-width: 768px) {
.footer-inner {
padding: 15px 10px;
gap: 10px;
padding: calc(var(--font-theme-size) * 0.9375) calc(var(--font-theme-size) * 0.625);
gap: calc(var(--font-theme-size) * 0.625);
}
.footer-copyright-engine {
font-size: 13px;
font-size: calc(var(--font-theme-size) * 0.8125);
line-height: 1.6;
}
.footer-copyright-site {
flex-direction: column;
gap: 8px;
font-size: 13px;
gap: calc(var(--font-theme-size) * 0.5);
font-size: calc(var(--font-theme-size) * 0.8125);
}
.footer-icp p {
flex-direction: column;
gap: 5px;
gap: calc(var(--font-theme-size) * 0.3125);
}
}
@media (max-width: 480px) {
.footer-inner {
padding: 12px 8px;
padding: calc(var(--font-theme-size) * 0.75) calc(var(--font-theme-size) * 0.5);
}
.footer-copyright-engine,
.footer-copyright-site {
font-size: 12px;
font-size: calc(var(--font-theme-size) * 0.75);
}
.footer-copyright-engine span,
+4 -4
View File
@@ -13,7 +13,7 @@
background-color: transparent;
color: var(--color-theme-header);
border-color: var(--color-theme-header);
margin: 0 0 0 .5rem;
margin: 0 0 0 calc(var(--font-theme-size) * 0.5);
padding: 0;
}
}
@@ -25,10 +25,10 @@
.header__logo::after {
content: "";
background: repeating-linear-gradient(90deg, var(--color-theme-header), var(--color-theme-header) 2px, transparent 0, transparent 10px);
background: repeating-linear-gradient(90deg, var(--color-theme-header), var(--color-theme-header) calc(var(--font-theme-size) * 0.125), transparent 0, transparent calc(var(--font-theme-size) * 0.625));
display: block;
width: 100%;
right: 10px;
right: calc(var(--font-theme-size) * 0.625);
}
.header__logo a {
@@ -44,7 +44,7 @@
background: var(--color-theme-header);
color: var(--color-theme-background);
font-weight: bold;
padding: 5px 10px;
padding: calc(var(--font-theme-size) * 0.3125) calc(var(--font-theme-size) * 0.625);
}
@media print {
+2 -2
View File
@@ -1,8 +1,8 @@
.icon-pixel,
.icon-regular {
display: none;
width: 1.5rem;
height: 1.5rem;
width: calc(var(--font-theme-size) * 1.5);
height: calc(var(--font-theme-size) * 1.5);
}
html[pixel_style='false'] .icon-regular {
+7 -7
View File
@@ -1,5 +1,5 @@
.link-section {
margin-bottom: 2rem;
margin-bottom: calc(var(--font-theme-size) * 2);
}
.link-table {
@@ -9,7 +9,7 @@
.link-item {
display: block;
margin-bottom: 0.5rem;
margin-bottom: calc(var(--font-theme-size) * 0.5);
text-decoration: none;
color: inherit;
}
@@ -20,12 +20,12 @@
.link-container {
display: flex;
padding: 0.25rem;
padding: calc(var(--font-theme-size) * 0.25);
align-items: center;
}
.link-logo {
width: 4rem;
width: calc(var(--font-theme-size) * 4);
height: auto;
flex-shrink: 0;
}
@@ -35,7 +35,7 @@
display: flex;
flex-direction: column;
justify-content: space-around;
min-height: 4rem;
min-height: calc(var(--font-theme-size) * 4);
}
.link-title {
@@ -45,12 +45,12 @@
.link-url {
color: var(--color-theme-accent);
font-size: 0.9em;
font-size: calc(var(--font-theme-size) * 0.9);
}
.link-description {
margin: 0;
color: var(--color-theme-foreground);
font-size: 0.9em;
font-size: calc(var(--font-theme-size) * 0.9);
line-height: 1.4;
}
+96 -71
View File
@@ -12,15 +12,11 @@
--color-theme-header: ;
--list-theme-marker: "►";
--font-theme-size: 1rem;
--line-theme-height: 1.54em;
--line-theme-height: calc(var(--font-theme-size) * 1.54);
--radius-theme-default: 0;
--font-theme-default: 'JetBrains Mono';
--font-theme-fallback: Monaco, Consolas, -apple-system, BlinkMacSystemFont, 'segoe ui',
Roboto, Oxygen, Ubuntu, Cantarell, 'open sans', 'helvetica neue';
@media (max-width: $phone-max-width) {
--font-theme-size: 0.95rem;
}
}
html {
@@ -57,6 +53,10 @@ body {
-webkit-font-smoothing: antialiased;
-webkit-overflow-scrolling: touch;
text-size-adjust: 100%;
@media (max-width: $phone-max-width) {
font-size: calc(var(--font-theme-size) * 0.95);
}
}
h1 {
@@ -94,7 +94,7 @@ img,
figure,
video,
table {
margin: 25px 0;
margin: calc(var(--font-theme-size) * 1.5625) 0;
}
a {
@@ -110,8 +110,8 @@ button {
text-align: center;
background: transparent;
color: var(--color-theme-accent);
padding: 5px 18px;
border: 4px solid var(--color-theme-accent);
padding: calc(var(--font-theme-size) * 0.315) calc(var(--font-theme-size) * 1.125);
border: calc(var(--font-theme-size) * 0.25) solid var(--color-theme-accent);
border-radius: var(--radius-theme-default);
transition: background 0.15s linear;
appearance: none;
@@ -131,9 +131,9 @@ a:focus-visible {
fieldset {
display: inline-block;
border: 2px solid var(--color-theme-foreground);
border-radius: calc(var(--radius-theme-default) * 1.6);
padding: 10px;
border: calc(var(--font-theme-size) * 0.125) solid var(--color-theme-foreground);
border-radius: var(--radius-theme-default);
padding: calc(var(--font-theme-size) * 0.625);
}
fieldset *:first-child {
@@ -162,9 +162,9 @@ textarea,
select {
background: transparent;
color: var(--color-theme-foreground);
border: 1px solid var(--color-theme-foreground);
border: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-foreground);
border-radius: var(--radius-theme-default);
padding: 10px;
padding: calc(var(--font-theme-size) * 0.625);
font: inherit;
appearance: none;
}
@@ -180,8 +180,8 @@ textarea:active,
select:focus-visible,
select:active {
border-color: var(--color-theme-accent);
outline: 1px solid var(--color-theme-accent);
outline-offset: 2px;
outline: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-accent);
outline-offset: calc(var(--font-theme-size) * 0.125);
}
input:active,
@@ -197,10 +197,10 @@ select {
var(--color-theme-foreground) 50%
),
linear-gradient(135deg, var(--color-theme-foreground) 50%, transparent 50%);
background-position: calc(100% - 20px), calc(100% - 1em);
background-size: 5px 5px, 5px 5px;
background-position: calc(100% - 1.25em), calc(100% - 1em);
background-size: calc(var(--font-theme-size) * 0.3125) calc(var(--font-theme-size) * 0.3125), calc(var(--font-theme-size) * 0.3125) calc(var(--font-theme-size) * 0.3125);
background-repeat: no-repeat;
padding-right: 40px;
padding-right: calc(var(--font-theme-size) * 2.5);
}
select option {
@@ -209,8 +209,7 @@ select option {
input[type="checkbox"] {
vertical-align: middle;
padding: 10px;
box-shadow: inset 0 0 0 3px var(--color-theme-background);
padding: calc(var(--font-theme-size) * 0.625);
}
input[type="checkbox"]:checked {
@@ -220,9 +219,9 @@ input[type="checkbox"]:checked {
img {
display: block;
max-width: 100%;
border: 4px solid var(--color-theme-accent);
border: calc(var(--font-theme-size) * 0.25) solid var(--color-theme-accent);
border-radius: var(--radius-theme-default);
padding: 4px;
padding: calc(var(--font-theme-size) * 0.25);
overflow: hidden;
}
@@ -267,8 +266,8 @@ figure figcaption {
text-align: center;
font-size: var(--font-theme-size);
font-weight: normal;
margin-top: -8px;
padding: 0 8px;
margin-top: calc(var(--font-theme-size) * -0.5);
padding: 0 calc(var(--font-theme-size) * 0.5);
border-radius: 0 0 var(--radius-theme-default) var(--radius-theme-default);
}
@@ -303,18 +302,18 @@ kbd {
font-family: inherit !important;
font-feature-settings: normal;
background: color-mix(in srgb, var(--color-theme-foreground) 5%, transparent);
border: 1px solid var(--code-border);
padding: 1px 6px;
margin: 0 2px;
border: calc(var(--font-theme-size) * 0.0625) solid var(--code-border);
padding: calc(var(--font-theme-size) * 0.0625) calc(var(--font-theme-size) * 0.375);
margin: 0 calc(var(--font-theme-size) * 0.125);
font-size: calc(var(--font-theme-size) * 0.95);
}
kbd {
border-top: 1px solid color-mix(in srgb, var(--color-theme-accent) 25%, transparent);
border-left: 1px solid var(--color-theme-accent);
border-right: 1px solid var(--color-theme-accent);
border-bottom: 4px solid var(--color-theme-accent);
border-radius: 4px;
border-top: calc(var(--font-theme-size) * 0.0625) solid color-mix(in srgb, var(--color-theme-accent) 25%, transparent);
border-left: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-accent);
border-right: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-accent);
border-bottom: calc(var(--font-theme-size) * 0.25) solid var(--color-theme-accent);
border-radius: calc(var(--font-theme-size) * 0.25);
}
code code {
@@ -328,11 +327,11 @@ pre {
tab-size: 4;
background: color-mix(in srgb, var(--color-theme-foreground) 5%, transparent) !important;
color: var(--color-theme-foreground);
padding: 10px 10px;
padding: calc(var(--font-theme-size) * 0.625) calc(var(--font-theme-size) * 0.625);
font-size: calc(var(--font-theme-size) * 0.95) !important;
overflow: auto;
border-radius: var(--radius-theme-default);
border: 1px solid color-mix(in srgb, var(--color-theme-foreground) 10%, transparent);
border: calc(var(--font-theme-size) * 0.0625) solid color-mix(in srgb, var(--color-theme-foreground) 10%, transparent);
@media (max-width: $phone-max-width) {
white-space: pre-wrap;
@@ -359,11 +358,11 @@ abbr {
}
sub {
bottom: -0.25em;
bottom: calc(var(--font-theme-size) * -0.25);
}
sup {
top: -0.25em;
top: calc(var(--font-theme-size) * -0.25);
}
mark {
@@ -373,11 +372,11 @@ mark {
blockquote {
position: relative;
border-top: 1px solid var(--color-theme-foreground);
border-bottom: 1px solid var(--color-theme-foreground);
border-left: .4rem solid var(--color-theme-foreground);
margin: 10px 0 10px 0;
padding: 20px;
border-top: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-foreground);
border-bottom: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-foreground);
border-left: calc(var(--font-theme-size) * 0.4) solid var(--color-theme-foreground);
margin: calc(var(--font-theme-size) * 0.625) 0 calc(var(--font-theme-size) * 0.625) 0;
padding: calc(var(--font-theme-size) * 1.25);
}
blockquote p:first-child {
@@ -396,8 +395,8 @@ table {
table,
th,
td {
border: 2px solid var(--color-theme-foreground);
padding: 10px;
border: calc(var(--font-theme-size) * 0.125) solid var(--color-theme-foreground);
padding: calc(var(--font-theme-size) * 0.625);
}
th {
@@ -405,14 +404,14 @@ th {
color: var(--color-theme-foreground);
text-align: left;
text-transform: uppercase;
letter-spacing: 0.04em;
letter-spacing: calc(var(--font-theme-size) * 0.04);
}
hr {
width: 100%;
border: none;
background: var(--color-theme-accent);
height: 2px;
height: calc(var(--font-theme-size) * 0.125);
}
/* One Heading Size */
@@ -422,9 +421,9 @@ hr {
.headings--one-size h4,
.headings--one-size h5,
.headings--one-size h6 {
font-size: 1.4rem;
font-size: calc(var(--font-theme-size) * 1.4);
line-height: 1.3;
margin: 20px 0;
margin: calc(var(--font-theme-size) * 1.25) 0;
}
.headings--one-size ~ h1:first-child,
@@ -433,7 +432,7 @@ hr {
.headings--one-size ~ h4:first-child,
.headings--one-size ~ h5:first-child,
.headings--one-size ~ h6:first-child {
margin-top: 20px;
margin-top: calc(var(--font-theme-size) * 1.25);
}
blockquote.twitter-tweet {
@@ -441,8 +440,8 @@ blockquote.twitter-tweet {
background: var(--color-theme-background);
font: inherit;
color: inherit;
border: 1px solid var(--color-theme-accent);
padding-top: 60px;
border: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-accent);
padding-top: calc(var(--font-theme-size) * 3.75);
}
blockquote.twitter-tweet a {
@@ -453,39 +452,65 @@ blockquote.twitter-tweet a {
blockquote.twitter-tweet::before {
content: "> From X:";
position: absolute;
top: 20px;
left: 20px;
top: calc(var(--font-theme-size) * 1.25);
left: calc(var(--font-theme-size) * 1.25);
color: var(--color-theme-accent);
font-weight: bold;
}
.container {
.page {
display: flex;
flex-direction: column;
padding: 40px;
max-width: 864px;
min-height: 80vh;
border-right: 1px solid color-mix(in srgb, var(--color-theme-accent) 10%, transparent);
@media (max-width: $phone-max-width) {
padding: 20px;
}
min-height: 100vh
}
.container.full, .container.center {
border: none;
.main-wrapper {
flex: 1;
display: flex;
flex-direction: column;
}
.layout-wrapper {
display: flex;
width: 100%;
flex: 1;
}
.sidebar-left,
.sidebar-right {
width: 20%;
flex-shrink: 0;
padding: calc(var(--font-theme-size) * 1.25);
}
.center.container {
flex: 1;
display: flex;
flex-direction: column;
padding: calc(var(--font-theme-size) * 2.5);
width: 60%;
margin: 0 auto;
}
.container.full {
max-width: 100%;
}
.content {
flex: 1;
display: flex;
flex-direction: column;
}
@media (max-width: 1024px) {
.sidebar-left,
.sidebar-right {
display: none;
}
}
@media (max-width: 768px) {
.center.container {
padding: calc(var(--font-theme-size) * 1.25);
}
}
.hidden {
display: none;
}
@@ -514,13 +539,13 @@ blockquote.twitter-tweet::before {
right: 0;
bottom: 0;
margin: auto;
width: 60px;
height: 60px;
width: calc(var(--font-theme-size) * 3.75);
height: calc(var(--font-theme-size) * 3.75);
}
iframe[src*="youtube.com"] {
border: 8px solid var(--color-theme-accent) !important;
padding: 8px !important;
border: calc(var(--font-theme-size) * 0.5) solid var(--color-theme-accent) !important;
padding: calc(var(--font-theme-size) * 0.5) !important;
}
@media print {
+15 -16
View File
@@ -4,7 +4,7 @@
display: flex;
align-items: flex-start;
justify-content: space-between;
margin: 20px 1px;
margin: calc(var(--font-theme-size) * 1.25) calc(var(--font-theme-size) * 0.0625);
a {
text-decoration: none;
@@ -33,29 +33,29 @@
}
li:not(:last-of-type) {
margin-bottom: 10px;
margin-bottom: calc(var(--font-theme-size) * 0.625);
}
.navigation-menu__inner li {
margin: 0;
padding: 5px;
padding: calc(var(--font-theme-size) * 0.3125);
}
}
}
.navigation-menu__inner > li {
flex: 0 0 auto;
margin-bottom: 10px;
margin-bottom: calc(var(--font-theme-size) * 0.625);
white-space: nowrap;
@media (max-width: $phone-max-width) {
margin: 0;
padding: 5px;
padding: calc(var(--font-theme-size) * 0.3125);
}
}
.navigation-menu__inner > li:not(:last-of-type) {
margin-right: 20px;
margin-right: calc(var(--font-theme-size) * 1.25);
}
.navigation-menu .spacer {
@@ -75,16 +75,16 @@
cursor: pointer;
background-color: var(--color-theme-background) !important;
margin-right: 0 !important;
padding-left: 5px;
padding-right: 5px;
padding-left: calc(var(--font-theme-size) * 0.3125);
padding-right: calc(var(--font-theme-size) * 0.3125);
color: var(--color-theme-menu);
user-select: none;
border: none;
display: inline-flex;
@media (max-width: $phone-max-width) {
padding-left: 10px;
padding-right: 10px;
padding-left: calc(var(--font-theme-size) * 0.625);
padding-right: calc(var(--font-theme-size) * 0.625);
margin-bottom: 0 !important;
outline: none;
-webkit-tap-highlight-color: transparent;
@@ -96,12 +96,11 @@
flex-direction: column;
position: absolute;
background: var(--color-theme-background);
box-shadow: 0 10px var(--color-theme-background), -10px 10px var(--color-theme-background), 10px 10px var(--color-theme-background);
color: var(--color-theme-accent);
border: 2px solid var(--color-theme-menu);
border: calc(var(--font-theme-size) * 0.125) solid var(--color-theme-menu);
margin: 0;
padding: 5px;
top: 25px;
padding: calc(var(--font-theme-size) * 0.3125);
top: calc(var(--font-theme-size) * 1.5625);
list-style: none;
z-index: 99;
@@ -116,12 +115,12 @@
}
.menu__dropdown > li:not(:last-of-type) {
margin-bottom: 10px;
margin-bottom: calc(var(--font-theme-size) * 0.625);
}
.menu__dropdown > li a {
display: flex;
padding: 5px;
padding: calc(var(--font-theme-size) * 0.3125);
text-decoration: underline;
}
+4 -4
View File
@@ -1,14 +1,14 @@
.moment-media {
display: grid;
gap: 0.5rem;
margin: 1rem 0;
gap: calc(var(--font-theme-size) * 0.5);
margin: var(--font-theme-size) 0;
width: 80%;
}
.moment-media video {
width: 100%;
height: 200px;
height: calc(var(--font-theme-size) * 12.5);
object-fit: cover;
border-radius: 8px;
border-radius: var(--font-theme-size);
transition: transform 0.3s ease;
}
+10 -10
View File
@@ -1,19 +1,19 @@
@import "variables";
.pagination {
margin-top: 10px;
margin-top: calc(var(--font-theme-size) * 0.625);
.pagination__title {
display: flex;
text-align: center;
position: relative;
margin: 10px 0 10px;
margin: calc(var(--font-theme-size) * 0.625) 0 calc(var(--font-theme-size) * 0.625);
}
.pagination__title-h {
text-align: center;
margin: 0 auto;
padding: 5px 10px;
padding: calc(var(--font-theme-size) * 0.3125) calc(var(--font-theme-size) * 0.625);
background: var(--color-theme-background);
color: color-mix(in srgb, var(--color-theme-foreground) 65%, transparent);
font-size: calc(var(--font-theme-size) * 0.8);
@@ -29,7 +29,7 @@
left: 0;
right: 0;
width: 100%;
margin-top: 15px;
margin-top: calc(var(--font-theme-size) * 0.9375);
z-index: 0;
}
@@ -37,21 +37,21 @@
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 20px;
gap: calc(var(--font-theme-size) * 1.25);
@media (min-width: calc(#{$phone-max-width} + 1px)) {
@media (min-width: $phone-min-width) {
flex-direction: row;
}
@media (max-width: $phone-max-width) {
flex-direction: column;
gap: 15px;
gap: calc(var(--font-theme-size) * 0.9375);
}
span {
display: flex;
@media (min-width: calc(#{$phone-max-width} + 1px)) {
@media (min-width: $phone-min-width) {
&:first-child {
margin-right: auto;
}
@@ -98,11 +98,11 @@
}
.next .button__icon {
margin-left: 8px;
margin-left: calc(var(--font-theme-size) * 0.5);
}
.prev .button__icon {
margin-right: 8px;
margin-right: calc(var(--font-theme-size) * 0.5);
}
.pagination__buttons:has(span:only-child) {
+35 -25
View File
@@ -1,12 +1,12 @@
@import "variables";
.index-content {
margin: 25px 0;
margin: calc(var(--font-theme-size) * 1.5625) 0;
}
.framed {
border: 1px solid var(--color-theme-framed);
padding: 20px;
border: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-framed);
padding: calc(var(--font-theme-size) * 1.25);
}
.framed *:first-child {
@@ -24,42 +24,42 @@
.post {
width: 100%;
text-align: left;
padding: 30px 0;
padding: calc(var(--font-theme-size) * 1.875) 0;
}
.post:not(:last-of-type) {
border-bottom: 1px solid color-mix(in srgb, var(--color-theme-foreground) 10%, transparent);
border-bottom: calc(var(--font-theme-size) * 0.0625) solid color-mix(in srgb, var(--color-theme-foreground) 10%, transparent);
}
.post-meta {
font-size: inherit;
margin-bottom: 10px;
font-size: calc(var(--font-theme-size) * 0.9);
margin-bottom: calc(var(--font-theme-size) * 0.625);
color: color-mix(in srgb, var(--color-theme-meta) 65%, transparent);
}
.post-meta > *:not(:first-child)::before {
content: "::";
display: inline-block;
margin: 0 8px;
margin: 0 calc(var(--font-theme-size) * 0.5);
}
.post-title {
position: relative;
color: var(--color-theme-title);
margin-top: 0 !important;
margin-bottom: 15px !important;
padding-bottom: 15px;
border-bottom: 3px dotted var(--color-theme-accent);
margin-bottom: calc(var(--font-theme-size) * 0.9375) !important;
padding-bottom: calc(var(--font-theme-size) * 0.9375) !important;
border-bottom: calc(var(--font-theme-size) * 0.1875) dotted var(--color-theme-accent);
text-decoration: none !important;
}
.post-title::after {
content: "";
position: absolute;
bottom: 2px;
bottom: calc(var(--font-theme-size) * 0.125);
display: block;
width: 100%;
border-bottom: 3px dotted var(--color-theme-accent);
border-bottom: calc(var(--font-theme-size) * 0.1875) dotted var(--color-theme-accent);
}
.post-title a {
@@ -69,7 +69,7 @@
.post-tags {
display: block;
margin-bottom: 20px;
margin-bottom: calc(var(--font-theme-size) * 0.625);
font-size: inherit;
}
@@ -81,16 +81,26 @@
}
}
.post-meta.post-tags {
font-size: calc(var(--font-theme-size) * 0.9);
}
.table-of-contents {
margin: 40px 0;
margin: calc(var(--font-theme-size) * 0.5) 0;
}
.post-excerpt {
font-size: calc(var(--font-theme-size) * 0.95);
margin-top: calc(var(--font-theme-size) * 0.625);
margin-bottom: calc(var(--font-theme-size) * 0.625);
}
.post-content {
margin-top: 25px;
margin-top: calc(var(--font-theme-size) * 1.5625);
}
.post-cover {
margin: 25px 0;
margin: calc(var(--font-theme-size) * 1.5625) 0;
}
.post ul {
@@ -100,7 +110,7 @@
.post ul li:not(:empty)::before {
content: var(--list-theme-marker);
position: absolute;
left: -20px;
left: calc(var(--font-theme-size) * -1.25);
color: var(--color-theme-foreground);
}
@@ -110,19 +120,19 @@
.post--regulation h2 {
justify-content: center;
margin-bottom: 10px;
margin-bottom: calc(var(--font-theme-size) * -0.625);
}
.post--regulation h2 + h2 {
margin-top: -10px;
margin-bottom: 20px;
margin-top: calc(var(--font-theme-size) * -0.625);
margin-bottom: calc(var(--font-theme-size) * 1.25);
}
.hanchor {
position: absolute;
color: var(--color-theme-accent);
text-decoration: none;
margin-left: 10px;
margin-left: calc(var(--font-theme-size) * 0.625);
visibility: hidden;
}
@@ -145,7 +155,7 @@ h6:hover .hanchor {
.post-list {
padding: .25rem 0;
padding: calc(var(--font-theme-size) * 0.25) 0;
a {
text-decoration: none;
@@ -154,7 +164,7 @@ h6:hover .hanchor {
@media (max-width: $phone-max-width) {
.post-cover {
padding: 10px;
border-width: 10px;
padding: calc(var(--font-theme-size) * 0.625);
border-width: calc(var(--font-theme-size) * 0.625);
}
}
+1
View File
@@ -1,4 +1,5 @@
search-modal {
--halo-search-widget-base-font-size: var(--font-theme-size) !important;
--halo-search-widget-base-font-family: var(--font-theme-default) !important;
--halo-search-widget-base-bg-color: var(--color-theme-background) !important;
--halo-search-widget-primary-color: var(--color-theme-accent) !important;
+51 -36
View File
@@ -1,29 +1,30 @@
.toc {
margin-left: 12px;
margin-left: calc(var(--font-theme-size) * 0.75);
position: fixed;
display: block;
z-index: 1000;
top: 20vh;
padding: 40px 12px 12px;
padding: calc(var(--font-theme-size) * 2.5) calc(var(--font-theme-size) * 0.75) calc(var(--font-theme-size) * 0.75);
.toc-content {
overflow: auto;
overflow: hidden;
display: none;
max-height: calc(100vh - 20vh - var(--font-theme-size) * 5);
}
&.toc-visible .toc-content {
display: block;
}
&::-webkit-scrollbar {
width: 6px;
.toc-content::-webkit-scrollbar {
width: calc(var(--font-theme-size) * 0.375);
}
&::-webkit-scrollbar-track {
.toc-content::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
.toc-content::-webkit-scrollbar-thumb {
background: var(--color-theme-foreground);
&:hover {
@@ -35,25 +36,24 @@
list-style: none;
padding: 0;
margin: 0;
max-height: calc(100vh - 120px);
}
.toc-list-item {
margin: 4px 0;
margin: calc(var(--font-theme-size) * 0.25) 0;
.toc-list {
margin-left: 16px;
border-left: 1px solid var(--color-theme-foreground);
padding-left: 8px;
margin-left: var(--font-theme-size);
border-left: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-foreground);
padding-left: calc(var(--font-theme-size) * 0.5);
}
}
.toc-link {
display: block;
padding: 4px 8px;
padding: calc(var(--font-theme-size) * 0.25) calc(var(--font-theme-size) * 0.5);
text-decoration: none;
color: var(--color-theme-foreground);
font-size: 0.875rem;
font-size: calc(var(--font-theme-size) * 0.875);
&:hover {
background: transparent;
@@ -72,8 +72,8 @@
@media (min-width: 1401px) {
.toc:not(.toc-visible) {
width: 32px;
height: 32px;
width: calc(var(--font-theme-size) * 2);
height: calc(var(--font-theme-size) * 2);
padding: 0;
background: transparent;
border: none;
@@ -86,10 +86,10 @@
.toc-toggle {
position: absolute;
top: -1px;
left: -1px;
width: 32px;
height: 32px;
top: calc(var(--font-theme-size) * -0.0625);
left: calc(var(--font-theme-size) * -0.0625);
width: calc(var(--font-theme-size) * 2);
height: calc(var(--font-theme-size) * 2);
padding: 0;
display: flex;
align-items: center;
@@ -99,7 +99,7 @@
border: none;
color: var(--color-theme-foreground);
cursor: pointer;
font-size: 16px;
font-size: var(--font-theme-size);
z-index: 1002;
&:hover {
@@ -110,59 +110,74 @@
@media (max-width: 1400px) {
.toc {
width: 32px;
height: 32px;
width: calc(var(--font-theme-size) * 2);
height: calc(var(--font-theme-size) * 2);
padding: 0;
border: none;
overflow: visible;
left: calc(100vw - 52px);
left: calc(100vw - var(--font-theme-size) * 3.25);
.toc-content {
display: none;
}
&.toc-visible {
width: 280px;
max-width: calc(100vw - 20px);
width: calc(var(--font-theme-size) * 17.5);
max-width: calc(100vw - var(--font-theme-size) * 1.25);
height: auto;
max-height: calc(100vh - 80px);
padding: 40px 12px 12px;
max-height: calc(100vh - var(--font-theme-size) * 5);
padding: calc(var(--font-theme-size) * 2.5) calc(var(--font-theme-size) * 0.75) calc(var(--font-theme-size) * 0.75);
background: var(--color-theme-background);
border: 1px solid var(--color-theme-foreground);
border: calc(var(--font-theme-size) * 0.0625) solid var(--color-theme-foreground);
z-index: 1001;
&.toc-overflow-right {
left: auto !important;
right: 10px;
right: calc(var(--font-theme-size) * 0.625);
}
.toc-content {
display: block;
overflow-y: auto;
max-height: calc(100vh - var(--font-theme-size) * 8.5);
}
.toc-list {
max-height: calc(100vh - 120px);
}
}
.toc-link {
font-size: 0.85rem;
padding: 5px 8px;
font-size: calc(var(--font-theme-size) * 0.85);
padding: calc(var(--font-theme-size) * 0.3125) calc(var(--font-theme-size) * 0.5);
}
.toc-list-item {
margin: 3px 0;
margin: calc(var(--font-theme-size) * 0.1875) 0;
}
}
}
@media (max-width: 480px) {
.toc.toc-visible {
width: calc(100vw - 200px);
max-width: max(calc(100vw - (var(--font-theme-size) * 12.5)), 50vw);
max-height: 60vh;
.toc-content {
max-height: calc(60vh - var(--font-theme-size) * 3.75);
overflow-y: auto;
}
.toc-list {
max-height: calc(60vh - 60px);
}
.toc-list-item {
margin: calc(var(--font-theme-size) * 0.125) 0;
}
.toc-link {
font-size: calc(var(--font-theme-size) * 0.70);
padding: calc(var(--font-theme-size) * 0.1) calc(var(--font-theme-size) * 0.1);
}
}
}
+12 -19
View File
@@ -14,32 +14,25 @@
<h1 class="post-title">
<a data-pjax th:text="${post.spec.title}" th:href="@{${post.status.permalink}}">Post Title</a>
</h1>
<div class="post-meta">
<span class="post-date" th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">
Publish Time
</span>
<span
class="post-author"
<section class="post-meta">
<span class="post-date"
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</span>
<span class="post-author"
th:with="contributor = ${post.contributors[0]}"
th:text="${contributor.displayName}"
>Author</span
>
</div>
<span class="post-tags">
th:text="${contributor.displayName}">Author</span>
</section>
<section class="post-tags">
<span class="post-tag" th:each="tag : ${post.tags}">
<a data-pjax
th:href="@{${tag.status.permalink}}"
th:title="${tag.spec.displayName}"
th:text="'#'+${tag.spec.displayName}"
>#Tag
</a>
th:text="'#'+${tag.spec.displayName}">#Tag</a>
</span>
</span>
</header>
<section class="post-content">
<p th:text="${post.status.excerpt}">Post Excerpt...</p>
</section>
</header>
<section class="post-excerpt">
<span th:text="${post.status.excerpt}">Post Excerpt...</span>
</section>
<section>
<a data-pjax class="read-more button inline" th:href="@{${post.status.permalink}}">[Read more]</a>
</section>
+13 -5
View File
@@ -53,18 +53,26 @@
</head>
<body>
<section class="center container">
<div class="page">
<div class="main-wrapper">
<div class="layout-wrapper">
<aside class="sidebar-left">
</aside>
<main class="center container">
<header class="header">
<th:block th:replace="~{modules/header :: header(isHome = true)}"/>
</header>
<main>
<div class="content">
<th:block th:replace="${content}"/>
</div>
</main>
</section>
<footer class="footer">
<aside class="sidebar-right">
</aside>
</div>
</div>
<footer class="footer">
<th:block th:replace="~{modules/footer}"/>
</footer>
</footer>
</div>
</body>
</html>