Skip to content

Commit 9015d46

Browse files
committed
CSS improvements
1 parent 0fafb8a commit 9015d46

3 files changed

Lines changed: 99 additions & 52 deletions

File tree

css/blog.css

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,40 @@
44

55
/* Remove default list spacing */
66
#posts-list {
7-
margin-top: 0;
8-
}
9-
10-
/* Stack each entry vertically */
11-
.post-entry {
12-
margin-bottom: 1.5rem;
13-
}
14-
15-
/* Title & Meta */
16-
.post-title {
17-
display: block;
18-
font-size: 1.5rem;
19-
color: #0055aa;
20-
margin-bottom: 0.25rem;
21-
}
22-
.post-meta-inline {
23-
display: block;
24-
font-size: 0.9rem;
25-
color: #777;
26-
margin-bottom: 0.5rem;
27-
}
28-
29-
/* Tag row under each entry */
30-
.tags-container {
31-
margin-top: 0.5rem;
32-
}
33-
7+
margin-top: 0;
8+
}
9+
10+
/* Stack each entry vertically */
11+
.post-entry {
12+
margin-bottom: 1.5rem;
13+
}
14+
15+
/* Title & Meta */
16+
.post-title {
17+
display: block;
18+
font-size: 1.5rem;
19+
color: #0055aa;
20+
margin-bottom: 0.25rem;
21+
}
22+
23+
.post-meta-inline {
24+
display: block;
25+
font-size: 0.9rem;
26+
color: #777;
27+
margin-bottom: 0.5rem;
28+
}
29+
30+
/* Tag row under each entry */
31+
.tags-container {
32+
margin-top: 0.5rem;
33+
}
34+
35+
.tag-button.selected {
36+
background-color: #99ccff;
37+
color: #fff;
38+
}
39+
40+
.dark-mode .tag-button.selected {
41+
background-color: #0055aa;
42+
color: #fff;
43+
}

css/post.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ article#post-content .post-meta {
2525
#comments-section {
2626
margin-top: 3rem;
2727
padding: 1.5rem;
28-
background-color: #f9f9f9;
28+
background-color: #666666;
2929
border-radius: 1rem;
3030
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
3131
}

css/shared.css

Lines changed: 61 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* ==========================================================================
2-
SHARED / GLOBAL STYLES
3-
========================================================================== */
4-
5-
/* — Reset & Box-Sizing — */
2+
RESET & BOX-SIZING
3+
========================================================================== */
64
html,
75
body,
86
*,
@@ -13,7 +11,9 @@ body,
1311
padding: 0;
1412
}
1513

16-
/* — Base Typography & Layout — */
14+
/* ==========================================================================
15+
BASE TYPOGRAPHY & LAYOUT
16+
========================================================================== */
1717
body {
1818
font-family: Georgia, 'Noto Serif', serif;
1919
max-width: 800px;
@@ -24,7 +24,6 @@ body {
2424
line-height: 1.8;
2525
}
2626

27-
/* — Headings & Paragraphs — */
2827
h1,
2928
h2,
3029
h3,
@@ -41,7 +40,9 @@ p {
4140
margin-bottom: 1rem;
4241
}
4342

44-
/* — Links — */
43+
/* ==========================================================================
44+
LINKS
45+
========================================================================== */
4546
a {
4647
color: #0055aa;
4748
text-decoration: none;
@@ -52,7 +53,9 @@ a:focus {
5253
text-decoration: underline;
5354
}
5455

55-
/* — Header & Nav — */
56+
/* ==========================================================================
57+
HEADER & NAVIGATION
58+
========================================================================== */
5659
.header-title {
5760
font-size: 2.5rem;
5861
font-weight: bold;
@@ -68,7 +71,6 @@ nav a {
6871
margin-right: 0.5rem;
6972
}
7073

71-
/* — Header Row (sub-heading + toggle) — */
7274
.header-row {
7375
display: flex;
7476
justify-content: space-between;
@@ -81,7 +83,9 @@ nav a {
8183
color: #555;
8284
}
8385

84-
/* — Buttons & Toggles — */
86+
/* ==========================================================================
87+
BUTTONS & TOGGLES
88+
========================================================================== */
8589
button,
8690
#theme-toggle,
8791
.tag-button {
@@ -102,18 +106,19 @@ button:hover,
102106
background-color: #ccddee;
103107
}
104108

105-
/* — Tag “Chips” — */
109+
/* ==========================================================================
110+
TAGS & FILTERS
111+
========================================================================== */
106112
.post-tag {
107113
display: inline-block;
108-
background-color: #eef;
109-
color: #336;
114+
background-color: #eee;
115+
color: #555;
110116
font-size: 0.85rem;
111117
padding: 0.3rem 0.7rem;
112118
border-radius: 0.6rem;
113119
margin: 0.2rem 0.3rem 0.2rem 0;
114120
}
115121

116-
/* — Filter Button Container — */
117122
#tag-filter {
118123
margin-top: 2rem;
119124
margin-bottom: 2rem;
@@ -123,7 +128,9 @@ button:hover,
123128
margin-top: 0.5rem;
124129
}
125130

126-
/* — Back Link — */
131+
/* ==========================================================================
132+
BACK LINK
133+
========================================================================== */
127134
.back-link {
128135
display: inline-block;
129136
margin-top: 2rem;
@@ -135,7 +142,9 @@ button:hover,
135142
text-decoration: underline;
136143
}
137144

138-
/* — Form Controls — */
145+
/* ==========================================================================
146+
FORM CONTROLS
147+
========================================================================== */
139148
input[type="text"],
140149
textarea {
141150
width: 100%;
@@ -151,7 +160,9 @@ textarea {
151160
resize: vertical;
152161
}
153162

154-
/* — Dark Mode — */
163+
/* ==========================================================================
164+
DARK MODE
165+
========================================================================== */
155166
.dark-mode,
156167
.dark-mode body {
157168
background-color: #0e0e0e;
@@ -162,18 +173,34 @@ textarea {
162173
color: #88aaff;
163174
}
164175

165-
.dark-mode button,
166-
.dark-mode #theme-toggle,
167-
.dark-mode .tag-button {
176+
.dark-mode button {
168177
background-color: transparent;
169-
color: #ddeeff;
178+
color: #def;
179+
border: none;
180+
}
181+
182+
.dark-mode button:hover {
183+
background-color: #456;
184+
}
185+
186+
.dark-mode #theme-toggle {
187+
background-color: transparent;
188+
color: #def;
189+
border: none;
190+
}
191+
192+
.dark-mode #theme-toggle:hover {
193+
background-color: #456;
194+
}
195+
196+
.dark-mode .tag-button {
197+
background-color: #456;
198+
color: #def;
170199
border: none;
171200
}
172201

173-
.dark-mode button:hover,
174-
.dark-mode #theme-toggle:hover,
175202
.dark-mode .tag-button:hover {
176-
background-color: #445566;
203+
background-color: #678;
177204
}
178205

179206
.dark-mode input[type="text"],
@@ -194,4 +221,14 @@ textarea {
194221

195222
.dark-mode .header-title {
196223
color: #cccccc;
224+
}
225+
226+
.dark-mode .header-row p {
227+
font-size: 1.2rem;
228+
color: #888888;
229+
}
230+
231+
.dark-mode .post-tag {
232+
background-color: #555;
233+
color: #eee;
197234
}

0 commit comments

Comments
 (0)