Skip to content

Commit 13db8a0

Browse files
committed
udpate: change styles(3)
- layouts/*.css -> layouts/_default/*.css - article in single page wider 10vw - add line numbers for code blocks
1 parent b3271c0 commit 13db8a0

File tree

8 files changed

+50
-18
lines changed

8 files changed

+50
-18
lines changed

assets/css/baseof.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:root {
2-
--font-base: go, system-ui;
2+
/* === fonts === */
3+
--font-regular: go, system-ui;
34
--font-mono: go-mono, monospace;
45

56
color-scheme: light dark;
@@ -17,7 +18,7 @@
1718
padding: 0;
1819
box-sizing: border-box;
1920

20-
font-family: var(--font-base);
21+
font-family: var(--font-regular);
2122
}
2223

2324
html,
File renamed without changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.single {
2+
grid-template-rows: min-content auto;
3+
}

assets/css/partials/article.css renamed to assets/css/layouts/partials/article.css

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
section.article {
2-
padding: 0 20vw;
2+
padding: 0 15vw;
33

44
display: flex;
55
flex-direction: column;
@@ -63,20 +63,56 @@ section.article {
6363
background: linear-gradient(to right, var(--dark-minor), var(--dark-bg) 60%);
6464
}
6565

66-
/* inline code */
67-
code{
68-
background-color: rgb(35, 102, 102);
69-
}
70-
71-
/* override the default style of per that might be generated by markup renderer */
7266
pre {
73-
overflow-x: auto;
67+
/* override the default style of per that might be generated by Goldmark */
7468
background-color: rgb(51, 60, 60) !important;
7569
* {
7670
font-family: var(--font-mono);
7771
}
72+
73+
code[data-lang] {
74+
&::before {
75+
display: block;
76+
77+
content: attr(data-lang);
78+
font-family: var(--font-mono);
79+
font-weight: bold;
80+
81+
padding: 1rem;
82+
background-color: rgb(44, 85, 85);
83+
}
84+
85+
counter-reset: line;
86+
> span {
87+
margin: .2rem auto;
88+
padding-left: 4rem;
89+
position: relative;
90+
/* === line numbers === */
91+
&:before {
92+
position: absolute;
93+
left: 0;
94+
content: counter(line);
95+
counter-increment: line;
96+
97+
width: 4rem;
98+
text-align: right;
99+
padding-right: 1.2rem;
100+
}
101+
102+
> span {
103+
padding-left: 1rem;
104+
border-left: 2px solid #fff;
105+
}
106+
}
107+
}
108+
}
109+
110+
/* inline code */
111+
code {
112+
background-color: rgb(35, 102, 102);
78113
}
79114

115+
80116
img {
81117
width: 60%;
82118
}
File renamed without changes.

assets/css/layouts/single.css

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)