Skip to content

Commit 159778b

Browse files
Merge pull request #650 from nebari-dev/fix/blog-underline-styling
fix(blog): remove link underlines on titles, authors, and sidebar
2 parents 35d83d6 + d7ae7ec commit 159778b

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

docs/src/scss/application.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
// Components
1010
@import "../theme/components/admonitions";
11+
@import "../theme/components/blog";
1112
@import "../theme/components/footer";
1213
@import "../theme/components/markdown";
1314
@import "../theme/components/menu";
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// ==============================================================================
2+
// Blog
3+
//
4+
// The global `a { text-decoration: underline }` mixin in core.scss adds an
5+
// underline to every link, which makes blog post titles, author names, and
6+
// the "Recent posts" sidebar entries look noisy. Opt the blog out of the
7+
// underline-at-rest behavior and restore an underline on hover so clickable
8+
// links keep their affordance — same opt-out pattern used by navbar/menu/
9+
// footer/admonitions.
10+
//
11+
// Scoped to Docusaurus' stable `.blog-wrapper` class (applied to <html> on
12+
// every blog route except /blog/archive). The archive selector below uses
13+
// `.plugin-blog`, also added to <html> by the blog plugin.
14+
// ==============================================================================
15+
16+
.blog-wrapper {
17+
header h1,
18+
header h2,
19+
header h1 a,
20+
header h2 a,
21+
.avatar a,
22+
.avatar__name a,
23+
aside nav a {
24+
text-decoration: none;
25+
&:hover {
26+
text-decoration: underline;
27+
}
28+
}
29+
}
30+
31+
[data-theme="dark"] .blog-wrapper {
32+
header h1,
33+
header h2,
34+
header h1 a,
35+
header h2 a,
36+
.avatar a,
37+
.avatar__name a,
38+
aside nav a {
39+
text-decoration: none;
40+
&:hover {
41+
text-decoration: underline;
42+
}
43+
}
44+
}
45+
46+
.plugin-blog main ul li a {
47+
text-decoration: none;
48+
&:hover {
49+
text-decoration: underline;
50+
}
51+
}

0 commit comments

Comments
 (0)