refactor: improve SCSS nesting structure

This commit is contained in:
Erzbir
2026-05-16 15:27:13 +08:00
parent f3002b58dc
commit be59fb0e06
19 changed files with 394 additions and 379 deletions
+133 -109
View File
@@ -1,119 +1,143 @@
.link-section {
margin-bottom: calc(var(--size-theme-font) * 3);
}
.link {
&-section {
margin-bottom: calc(var(--size-theme-font) * 3);
}
.link-section-header {
display: flex;
align-items: center;
margin-bottom: calc(var(--size-theme-font) * 1.25);
h2 {
&-section-header {
display: flex;
align-items: center;
font-size: calc(var(--size-theme-font) * 0.9);
font-weight: normal;
letter-spacing: 0.15em;
text-transform: uppercase;
line-height: 1;
white-space: nowrap;
margin: 0;
margin-bottom: calc(var(--size-theme-font) * 1.25);
&::before { content: "┌─["; color: var(--color-theme-accent); opacity: 0.4; }
&::after { content: "]"; color: var(--color-theme-accent); opacity: 0.4; }
h2 {
display: flex;
align-items: center;
font-size: calc(var(--size-theme-font) * 0.9);
font-weight: normal;
letter-spacing: 0.15em;
text-transform: uppercase;
line-height: 1;
white-space: nowrap;
margin: 0;
> span {
color: var(--color-theme-accent);
padding: 0.1em 0.45em;
border-top: var(--width-theme-border) var(--style-theme-border) var(--color-theme-accent);
border-bottom: var(--width-theme-border) var(--style-theme-border) var(--color-theme-accent);
&::before {
content: "┌─[";
color: var(--color-theme-accent);
opacity: 0.4;
}
&::after {
content: "]";
color: var(--color-theme-accent);
opacity: 0.4;
}
> span {
color: var(--color-theme-accent);
padding: 0.1em 0.45em;
border-top: var(--width-theme-border) var(--style-theme-border) var(--color-theme-accent);
border-bottom: var(--width-theme-border) var(--style-theme-border) var(--color-theme-accent);
}
}
&::after {
content: "";
flex: 1;
height: var(--width-theme-border);
background-color: var(--color-theme-framed);
margin-left: 0.6em;
opacity: 0.5;
}
}
&::after {
content: "";
flex: 1;
height: var(--width-theme-border);
background-color: var(--color-theme-framed);
margin-left: 0.6em;
opacity: 0.5;
&-table {
width: 100%;
border-collapse: collapse;
}
&-item {
display: block;
padding: calc(var(--size-theme-font) * 0.55) calc(var(--size-theme-font) * 0.55);
text-decoration: none;
color: inherit;
}
&-container {
display: grid;
grid-template-columns: calc(var(--size-theme-font) * 3.5) 1fr;
gap: calc(var(--size-theme-font) * 0.75);
align-items: center;
}
&-logo-wrap {
width: calc(var(--size-theme-font) * 3.5);
height: calc(var(--size-theme-font) * 3.5);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
&-logo {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
&-content {
display: flex;
flex-direction: column;
gap: calc(var(--size-theme-font) * 0.15);
min-width: 0;
}
&-title {
display: flex;
align-items: baseline;
flex-wrap: wrap;
gap: calc(var(--size-theme-font) * 0.5);
}
&-name {
color: var(--color-theme-foreground);
&::before {
content: "> ";
color: var(--color-theme-accent);
opacity: 0.55;
}
}
&-url {
color: var(--color-theme-meta);
font-size: calc(var(--size-theme-font) * 0.8);
opacity: 0.7;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&-description {
color: var(--color-theme-foreground);
font-size: calc(var(--size-theme-font) * 0.82);
line-height: var(--height-theme-line);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
opacity: 0.8;
}
@media (max-width: 600px) {
&-url {
display: none;
}
&-description {
white-space: normal;
}
&-container {
grid-template-columns: calc(var(--size-theme-font) * 3) 1fr;
}
}
}
.link-table {
width: 100%;
border-collapse: collapse;
}
.link-item {
display: block;
padding: calc(var(--size-theme-font) * 0.55) calc(var(--size-theme-font) * 0.55);
text-decoration: none;
color: inherit;
}
.link-container {
display: grid;
grid-template-columns: calc(var(--size-theme-font) * 3.5) 1fr;
gap: calc(var(--size-theme-font) * 0.75);
align-items: center;
}
.link-logo-wrap {
width: calc(var(--size-theme-font) * 3.5);
height: calc(var(--size-theme-font) * 3.5);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.link-logo {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.link-content {
display: flex;
flex-direction: column;
gap: calc(var(--size-theme-font) * 0.15);
min-width: 0;
}
.link-title {
display: flex;
align-items: baseline;
flex-wrap: wrap;
gap: calc(var(--size-theme-font) * 0.5);
}
.link-name {
color: var(--color-theme-foreground);
&::before { content: "> "; color: var(--color-theme-accent); opacity: 0.55; }
}
.link-url {
color: var(--color-theme-meta);
font-size: calc(var(--size-theme-font) * 0.8);
opacity: 0.7;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.link-description {
color: var(--color-theme-foreground);
font-size: calc(var(--size-theme-font) * 0.82);
line-height: var(--height-theme-line);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
opacity: 0.8;
}
@media (max-width: 600px) {
.link-url { display: none; }
.link-description { white-space: normal; }
.link-container { grid-template-columns: calc(var(--size-theme-font) * 3) 1fr; }
}