Skip to content

Commit fb68af2

Browse files
committed
feat(css): abstracted common css into single file for all services
It was becoming tedious to make the same change in three different css files, so I abstracted the main styling into a single file and am now copying the css into each service's public directory with `make css`.
1 parent ed3a7c3 commit fb68af2

File tree

13 files changed

+2617
-496
lines changed

13 files changed

+2617
-496
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ DOCKER_TAG?=$(shell git log --format="%H" -n 1)
77
DOCKER_PLATFORM?=linux/amd64,linux/arm64
88
DOCKER_BUILDX_BUILD?=docker buildx build --push --platform $(DOCKER_PLATFORM)
99

10+
css:
11+
cp ./smol.css lists/public/main.css
12+
cp ./smol.css prose/public/main.css
13+
cp ./smol.css pastes/public/main.css
14+
15+
cp ./syntax.css pastes/public/syntax.css
16+
cp ./syntax.css prose/public/syntax.css
17+
.PHONY: css
18+
1019
lint:
1120
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:latest golangci-lint run -E goimports -E godot
1221
.PHONY: lint

lists/html/blog.page.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<article>
5656
<div class="flex items-center">
5757
<time datetime="{{.UpdatedAtISO}}" class="font-italic text-sm post-date">{{.UpdatedTimeAgo}}</time>
58-
<h2 class="font-bold flex-1"><a href="{{.URL}}">{{.Title}}</a></h2>
58+
<div class="font-bold flex-1"><a href="{{.URL}}">{{.Title}}</a></div>
5959
</div>
6060
</article>
6161
{{end}}

lists/html/read.page.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div class="flex items-center">
2323
<time datetime="{{.UpdatedAtISO}}" class="font-italic text-sm post-date">{{.UpdatedTimeAgo}}</time>
2424
<div class="flex-1">
25-
<h2 class="inline"><a href="{{.URL}}">{{.Title}}</a></h2>
25+
<div class="inline"><a href="{{.URL}}">{{.Title}}</a></div>
2626
<address class="text-sm inline">
2727
<a href="{{.BlogURL}}" class="link-grey">({{.Username}})</a>
2828
</address>

lists/public/main.css

Lines changed: 60 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
1-
*, ::before, ::after {
1+
*,
2+
::before,
3+
::after {
24
box-sizing: border-box;
35
}
46

57
::-moz-focus-inner {
6-
border-style: none;
7-
padding: 0;
8+
border-style: none;
9+
padding: 0;
10+
}
11+
:-moz-focusring {
12+
outline: 1px dotted ButtonText;
13+
}
14+
:-moz-ui-invalid {
15+
box-shadow: none;
816
}
9-
:-moz-focusring { outline: 1px dotted ButtonText; }
10-
:-moz-ui-invalid { box-shadow: none; }
1117

1218
@media (prefers-color-scheme: light) {
1319
:root {
1420
--white: #6a737d;
15-
--code: rgba(255, 229, 100, 0.2);
21+
--code: #fff8d3;
22+
--code-border: #f0d547;
1623
--pre: #f6f8fa;
1724
--bg-color: #fff;
1825
--text-color: #24292f;
1926
--link-color: #005cc5;
2027
--visited: #6f42c1;
21-
--blockquote: #785840;
28+
--blockquote: #005cc5;
2229
--blockquote-bg: #fff;
2330
--hover: #d73a49;
2431
--grey: #ccc;
@@ -28,7 +35,8 @@
2835
@media (prefers-color-scheme: dark) {
2936
:root {
3037
--white: #f2f2f2;
31-
--code: #252525;
38+
--code: #414558;
39+
--code-border: #252525;
3240
--pre: #252525;
3341
--bg-color: #282a36;
3442
--text-color: #f2f2f2;
@@ -45,52 +53,62 @@ html {
4553
background-color: var(--bg-color);
4654
color: var(--text-color);
4755
line-height: 1.5;
48-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
49-
"Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji",
50-
"Segoe UI Emoji", "Segoe UI Symbol";
51-
-webkit-text-size-adjust: 100%;
52-
-moz-tab-size: 4;
53-
tab-size: 4;
56+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
57+
Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial,
58+
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
59+
-webkit-text-size-adjust: 100%;
60+
-moz-tab-size: 4;
61+
tab-size: 4;
62+
font-size: 17px;
5463
}
5564

5665
body {
5766
margin: 0 auto;
58-
max-width: 35rem;
67+
max-width: 42rem;
5968
}
6069

6170
img {
6271
max-width: 100%;
6372
height: auto;
6473
}
6574

66-
b, strong {
75+
b,
76+
strong {
6777
font-weight: bold;
6878
}
6979

70-
code, kbd, samp, pre {
71-
font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
72-
font-size: 0.8rem;
80+
code,
81+
kbd,
82+
samp,
83+
pre {
84+
font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo,
85+
monospace;
86+
font-size: 0.8rem;
7387
}
7488

75-
code, kbd, samp {
89+
code,
90+
kbd,
91+
samp {
7692
background-color: var(--code);
93+
border: 1px solid var(--code-border);
7794
}
7895

7996
pre > code {
8097
background-color: inherit;
8198
padding: 0;
99+
border: none;
82100
}
83101

84102
code {
85103
border-radius: 0.3rem;
86-
padding: .15rem .2rem .05rem;
104+
padding: 0.15rem 0.2rem 0.05rem;
87105
}
88106

89107
pre {
90108
border-radius: 5px;
91109
padding: 1rem;
110+
margin: 1rem 0;
92111
overflow-x: auto;
93-
margin: 0;
94112
background-color: var(--pre) !important;
95113
}
96114

@@ -102,10 +120,12 @@ summary {
102120
display: list-item;
103121
}
104122

105-
h1, h2, h3 {
123+
h1,
124+
h2,
125+
h3 {
106126
margin: 0;
107-
padding: 0;
108-
border: 0;
127+
padding: 0.6rem 0 0 0;
128+
border: 0;
109129
font-style: normal;
110130
font-weight: inherit;
111131
font-size: inherit;
@@ -126,7 +146,8 @@ a {
126146
color: var(--link-color);
127147
}
128148

129-
a:hover, a:visited:hover {
149+
a:hover,
150+
a:visited:hover {
130151
color: var(--hover);
131152
}
132153

@@ -144,7 +165,7 @@ a.link-grey:visited {
144165
}
145166

146167
section {
147-
margin-bottom: 2rem;
168+
margin-bottom: 1.4rem;
148169
}
149170

150171
section:last-child {
@@ -166,11 +187,16 @@ article {
166187
blockquote {
167188
border-left: 5px solid var(--blockquote);
168189
background-color: var(--blockquote-bg);
169-
padding: 0.5rem;
170-
margin: 0.5rem 0;
190+
padding: 0.8rem;
191+
margin: 1rem 0;
192+
}
193+
194+
blockquote > p {
195+
margin: 0;
171196
}
172197

173-
ul, ol {
198+
ul,
199+
ol {
174200
padding: 0 0 0 2rem;
175201
list-style-position: outside;
176202
}
@@ -201,7 +227,7 @@ dd {
201227
}
202228

203229
dd:not(:last-child) {
204-
margin-bottom: .5rem;
230+
margin-bottom: 0.5rem;
205231
}
206232

207233
.post-date {
@@ -213,17 +239,17 @@ dd:not(:last-child) {
213239
}
214240

215241
.text-2xl {
216-
font-size: 1.5rem;
242+
font-size: 1.85rem;
217243
line-height: 1.15;
218244
}
219245

220246
.text-xl {
221-
font-size: 1.25rem;
247+
font-size: 1.45rem;
222248
line-height: 1.15;
223249
}
224250

225251
.text-lg {
226-
font-size: 1.125rem;
252+
font-size: 1.25rem;
227253
line-height: 1.15;
228254
}
229255

0 commit comments

Comments
 (0)