Skip to content

Commit 04097d2

Browse files
authored
Merge pull request #718 from craftcms/lupe/pt-1079-global-link-color-is-not-contrasted-enough-from-background
Updates colors globally to improve visibility of links and dark mode switcher; also adds underlines to inline links
2 parents 92a1dfd + 82fefb6 commit 04097d2

File tree

14 files changed

+57
-23
lines changed

14 files changed

+57
-23
lines changed

docs/.vuepress/components/Poi.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ export default {
7676
}
7777
7878
.active {
79-
background-color: theme("colors.blue");
79+
background-color: theme("colors.blue.default");
8080
}
8181
</style>

docs/.vuepress/components/See.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export default {
7979
}
8080
8181
.see-title {
82-
@apply text-lg font-medium text-blue;
82+
color: var(--link-color-default);
83+
@apply text-lg font-medium;
8384
}
8485
8586
.see:hover .see-title {

docs/.vuepress/sets/craft-cms.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ module.exports = {
203203
"update",
204204
"deploy",
205205
"upgrade",
206-
"configure",
206+
["configure", 'Configuration'],
207207
]
208208
},
209209
{

docs/.vuepress/theme/components/ColorModeSwitch.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
<style lang="postcss">
1717
.dark-mode-toggle {
18+
--lightswitch-color: var(--ui-component-color);
19+
border-color: var(--lightswitch-color);
1820
@apply inline-block border border-2 rounded-full h-5 relative mt-4 outline-none appearance-none overflow-hidden;
1921
width: 44px;
2022
height: 22px;
@@ -30,7 +32,7 @@
3032
width: 14px;
3133
height: 14px;
3234
transition: all 0.25s cubic-bezier(0.86, 0, 0.07, 1);
33-
background: #a0aec0;
35+
background: var(--lightswitch-color);
3436
3537
&:after {
3638
content: "";
@@ -42,7 +44,6 @@
4244
4345
.dark-mode-toggle {
4446
&.dark {
45-
border-color: rgba(45, 55, 72, 1);
4647
background: transparent;
4748
4849
.knob {

docs/.vuepress/theme/components/DocSetPanel.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
8686
.home {
8787
@apply text-sm relative;
88-
color: #718096;
88+
color: var(--text-color-muted);
8989
9090
.back {
9191
@apply inline-block absolute mr-1 opacity-100;
@@ -119,7 +119,8 @@
119119
}
120120
121121
.home-title {
122-
@apply relative pl-0 text-blue;
122+
color: var(--link-color-default);
123+
@apply relative pl-0;
123124
left: -2px;
124125
}
125126
}

docs/.vuepress/theme/components/PostHeading.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@
5151
@apply p-0 text-xs mx-0 mb-2 tracking-wide uppercase;
5252
}
5353
}
54+
55+
.theme-dark & {
56+
.post-heading {
57+
.sidebar-links {
58+
li {
59+
a {
60+
@apply text-blue-lighter px-0;
61+
}
62+
}
63+
}
64+
}
65+
}
5466
}
5567
5668
.version-warning {

docs/.vuepress/theme/components/RightBar.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default {
6363
}
6464
6565
.sidebar-links {
66+
--sidebar-link-color: var(--text-color-muted);
6667
@apply ml-0 pl-0 pb-4 overflow-y-auto;
6768
max-height: calc(100vh - 6.5rem);
6869
@@ -73,12 +74,6 @@ export default {
7374
7475
.sidebar-link {
7576
@apply mx-0 px-0 border-0 pr-4;
76-
color: var(--sidebar-link-color);
77-
opacity: 0.7;
78-
79-
&:hover {
80-
@apply text-blue opacity-100;
81-
}
8277
8378
&.active {
8479
@apply opacity-100;

docs/.vuepress/theme/global-components/BrowserShot.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
}
144144
145145
.point--active {
146-
background-color: theme("colors.blue");
146+
background-color: theme("colors.blue.default");
147147
transform: scale(1.25);
148148
}
149149
</style>

docs/.vuepress/theme/styles/base.pcss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
:root {
22
--text-color: theme("colors.slate");
3+
--text-color-muted: #6D7480;
4+
--ui-component-color: #8491A4;
35
--bg-color: theme("colors.white");
46
--sidebar-bg-color: theme("colors.softer");
57
--search-bg-color: theme("colors.soft");
68
--dl-color: theme("colors.soft-gray");
79
--medium-zoom-overlay-color: theme("colors.soft");
810
--heading-color: theme("colors.slate");
11+
--link-color-default: theme("colors.blue.default");
12+
--link-underline-color: #5E8BF7;
913
--sidebar-link-color: theme("colors.slate");
10-
--sidebar-active-link-color: theme("colors.blue");
14+
--sidebar-active-link-color: theme("colors.blue.default");
1115
--hamburger-color: theme("colors.black");
1216
--tooltip-bg-color: theme("colors.white");
1317
--border-color: #e2e8f0;
@@ -50,7 +54,8 @@ body {
5054
}
5155

5256
a {
53-
@apply text-blue no-underline;
57+
@apply no-underline;
58+
color: var(--link-color-default);
5459
}
5560

5661
img {

docs/.vuepress/theme/styles/color-mode.pcss

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,46 @@
11
/* initial load, no class on html element */
22
@media (prefers-color-scheme: light) {
33
html:not([class]) {
4-
--bg-color: theme("colors.white");
4+
--bg-color: theme("colors.white")
55
}
66
}
77

88
@media (prefers-color-scheme: dark) {
99
html:not([class]) {
1010
--text-color: theme("colors.white");
11+
--text-color-muted: #818EA2;
12+
--ui-component-color: theme("colors.gray.600");
1113
--bg-color: theme("colors.gray.900");
1214
--sidebar-bg-color: rgba(0, 0, 0, 0.1);
1315
--search-bg-color: theme("colors.slate");
1416
--dl-color: theme("colors.soft-gray");
1517
--heading-color: theme("colors.gray.100");
16-
--sidebar-link-color: theme("colors.gray.500");
1718
--border-color: theme("colors.slate");
1819
--doc-set-color: theme("colors.gray.200");
1920
--code-highlight-color: rgba(45, 55, 72, 0.25);
2021
--code-bg-color: theme("colors.cinder");
2122
--custom-block-bg-color: theme("colors.slate");
2223
--custom-block-border-color: transparent;
24+
25+
/* Links */
26+
--link-color-default: theme("colors.blue.lighter");
27+
--link-underline-color: var(--link-color-default);
28+
--sidebar-link-color: theme("colors.gray.400");
29+
--sidebar-active-link-color: var(--link-color-default);
2330
}
2431
}
2532

2633
/* JS-applied, which may differ from browser setting */
2734
.theme-dark {
2835
--text-color: theme("colors.white");
36+
--text-color-muted: #818EA2;
37+
--ui-component-color: theme("colors.gray.600");
2938
--bg-color: theme("colors.gray.900");
3039
--sidebar-bg-color: rgba(0, 0, 0, 0.1);
3140
--search-bg-color: theme("colors.slate");
3241
--dl-color: rgba(0, 0, 0, 0.2);
3342
--medium-zoom-overlay-color: rgba(23, 29, 40, 1);
3443
--heading-color: theme("colors.gray.100");
35-
--sidebar-link-color: theme("colors.gray.400");
3644
--hamburger-color: theme("colors.white");
3745
--tooltip-bg-color: theme("colors.gray.800");
3846
--border-color: theme("colors.slate");
@@ -42,6 +50,12 @@
4250
--custom-block-bg-color: theme("colors.slate");
4351
--custom-block-border-color: transparent;
4452

53+
/* Links */
54+
--link-color-default: theme("colors.blue.lighter");
55+
--link-underline-color: var(--link-color-default);
56+
--sidebar-link-color: theme("colors.gray.400");
57+
--sidebar-active-link-color: var(--link-color-default);
58+
4559
.link-panel {
4660
background-color: var(--border-color);
4761
border-color: rgba(255, 255, 255, 0.05);

0 commit comments

Comments
 (0)