Skip to content

Commit 747d609

Browse files
Polish breadcrumbs and header: better spacing, softer separators, mobile responsiveness
1 parent ca70212 commit 747d609

1 file changed

Lines changed: 52 additions & 6 deletions

File tree

courses/static/courses.css

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
header nav {
33
max-width: 720px;
44
margin: 0 auto; /* Centers the navigation horizontally */
5-
padding: 20px 0; /* Vertical padding to match your content block */
5+
padding: 16px 0; /* Vertical padding to match your content block */
66
display: flex;
77
justify-content: space-between; /* This will space your list and logout/login */
88
align-items: center; /* This will align the items vertically */
@@ -29,16 +29,34 @@ nav .breadcrumbs ul {
2929

3030
/* Style each list item */
3131
nav .breadcrumbs ul li {
32-
margin-right: 0.25rem; /* Add some space between the breadcrumbs */
32+
margin-right: 0.5rem;
33+
font-size: 0.9rem;
34+
white-space: nowrap;
35+
}
36+
37+
nav .breadcrumbs ul li a {
38+
max-width: 200px;
39+
overflow: hidden;
40+
text-overflow: ellipsis;
41+
display: inline-block;
42+
vertical-align: middle;
3343
}
3444

3545
/* Add ">" before each li except the first one using a pseudo-element */
3646
nav .breadcrumbs ul li:not(:first-child)::before {
3747
content: "\f105"; /* FontAwesome's right arrow icon */
3848
font-family: "Font Awesome 5 Free";
39-
color: #000;
40-
padding-right: 0.25rem; /* Add some space before the breadcrumb text */
41-
font-weight: 900; /* Bold */
49+
color: #6c757d;
50+
padding-right: 0.5rem;
51+
font-weight: 900;
52+
font-size: 0.75em;
53+
vertical-align: middle;
54+
}
55+
56+
/* Right-side controls */
57+
header nav > div:last-child ul li {
58+
font-size: 0.9rem;
59+
white-space: nowrap;
4260
}
4361

4462

@@ -95,6 +113,34 @@ nav .breadcrumbs ul li:not(:first-child)::before {
95113
}
96114
}
97115

116+
@media (max-width: 768px) {
117+
header nav {
118+
flex-direction: column;
119+
align-items: flex-start;
120+
gap: 0.5rem;
121+
padding: 12px 0;
122+
}
123+
124+
nav .breadcrumbs ul {
125+
flex-wrap: wrap;
126+
gap: 0.25rem 0;
127+
}
128+
129+
nav .breadcrumbs ul li a {
130+
max-width: 150px;
131+
}
132+
}
133+
134+
@media (max-width: 480px) {
135+
nav .breadcrumbs ul li {
136+
font-size: 0.8rem;
137+
}
138+
139+
nav .breadcrumbs ul li a {
140+
max-width: 100px;
141+
}
142+
}
143+
98144
.text-muted a, .text-muted a:visited, .text-muted a:hover, .text-muted a:focus, .text-muted a:active {
99145
color: inherit; /* This makes the link use the color of the parent .text-muted class */
100146
}
@@ -239,7 +285,7 @@ body.dark-mode .breadcrumbs a {
239285
}
240286

241287
body.dark-mode nav .breadcrumbs ul li:not(:first-child)::before {
242-
color: #eaeaea;
288+
color: #b0b0b0;
243289
}
244290

245291
body.dark-mode .form-control {

0 commit comments

Comments
 (0)