Skip to content

Commit 8199ef2

Browse files
author
Jacek Gębal
committed
Improve link, hover and top bar contrast in light and dark themes
1 parent 1a89a53 commit 8199ef2

2 files changed

Lines changed: 22 additions & 14 deletions

File tree

‎docs/assets/topbar.css‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
#utplsql-topbar a {
17-
color: rgba(255,255,255,0.72);
17+
color: rgba(255,255,255,0.88);
1818
text-decoration: none;
1919
padding: 0 0.5rem;
2020
line-height: 2rem;
@@ -60,7 +60,7 @@
6060
background: none;
6161
border: none;
6262
cursor: pointer;
63-
color: rgba(255,255,255,0.72);
63+
color: rgba(255,255,255,0.88);
6464
padding: 0 0.4rem;
6565
height: 2rem;
6666
display: flex;
@@ -128,7 +128,7 @@
128128
background: none;
129129
border: none;
130130
cursor: pointer;
131-
color: rgba(255,255,255,0.72);
131+
color: rgba(255,255,255,0.88);
132132
padding: 0 0.4rem;
133133
height: 2rem;
134134
align-items: center;

‎docs/stylesheets/extra.css‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
[data-md-color-scheme="default"] {
2-
--md-primary-fg-color: #2f8bff;
3-
--md-accent-fg-color: #1f5db0;
4-
--md-accent-fg-color--transparent: #1f5db0;
2+
--md-primary-fg-color: #1565c0; /* link + header colour: 5.8:1 with white text */
3+
--md-typeset-a-color: #1565c0; /* link = header colour: 5.8:1 */
4+
--md-accent-fg-color: #1e88e5; /* hover: lighter than the link, 3.7:1 */
5+
--md-accent-fg-color--transparent: rgba(30, 136, 229, .1);
6+
--md-default-fg-color--light: hsla(0, 0%, 0%, .64); /* muted text 6.7:1 */
57
}
68

79
[data-md-color-scheme="slate"] {
8-
--md-hue: 200;
9-
--md-primary-fg-color: #2f8bff;
10-
--md-accent-fg-color: #1f5db0;
11-
--md-accent-fg-color--transparent: #1f5db0;
10+
--md-hue: 215;
11+
--md-primary-fg-color: #1565c0; /* header background keeps the brand blue */
12+
--md-accent-fg-color: #3578cc; /* hover: darker than the link, 3.6:1 */
13+
--md-accent-fg-color--transparent: rgba(53, 120, 204, .1);
14+
--md-default-fg-color: hsla(var(--md-hue), 15%, 90%, .90); /* body ~10:1 */
15+
--md-default-fg-color--light: hsla(var(--md-hue), 15%, 90%, .68); /* muted 6.5:1 */
16+
--md-code-hl-keyword-color: hsl(219, 80%, 72%);
17+
}
18+
19+
/* Material sets the dark link colour per primary colour with higher specificity */
20+
[data-md-color-scheme="slate"][data-md-color-primary] {
21+
--md-typeset-a-color: #4a90e2; /* link: header blue lightened just enough to read on dark, 4.8:1 */
1222
}
1323

1424
/* Latest news cards on the home page (generated by hooks/latest_posts.py) */
@@ -34,12 +44,10 @@
3444
.latest-posts__more {
3545
margin-top: auto;
3646
font-size: .7rem;
37-
color: var(--md-accent-fg-color);
47+
color: var(--md-typeset-a-color);
3848
}
3949

40-
[data-md-color-scheme="slate"] .latest-posts__more {
41-
color: var(--md-primary-fg-color);
42-
}
50+
4351

4452
/* Material's pin badge (md-pin) is a flex item on the Announcements page - align it inline here */
4553
.latest-posts__meta .md-pin {

0 commit comments

Comments
 (0)