Skip to content

Commit 748fd36

Browse files
authored
Merge pull request #1087 from rust-lang/dark-mode
Tweak some dark-mode colors to improve contrast a smidge
2 parents 2115824 + 5e1f839 commit 748fd36

File tree

7 files changed

+43
-26
lines changed

7 files changed

+43
-26
lines changed

ui/frontend/ButtonSet.module.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ $radius: 4px;
8787
color: var(--button-secondary-color-light);
8888
}
8989

90+
&:visited {
91+
color: var(--button-secondary-color);
92+
}
93+
9094
&:hover:enabled {
9195
background: inherit;
9296
background-color: var(--button-secondary-border-color);
@@ -118,8 +122,3 @@ $radius: 4px;
118122
aspect-ratio: 1/1;
119123
justify-items: center;
120124
}
121-
122-
a.iconLink svg,
123-
a.iconLink:visited svg {
124-
fill: var(--font-color) !important;
125-
}

ui/frontend/ButtonSet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ IconButton.displayName = 'IconButton';
7979

8080
export const IconLink = React.forwardRef<HTMLAnchorElement, LinkProps>(
8181
({ children, ...props }, ref) => (
82-
<Link ref={ref} className={`${styles.icon} ${styles.iconLink}`} {...props}>
82+
<Link ref={ref} className={styles.icon} {...props}>
8383
{children}
8484
</Link>
8585
),

ui/frontend/Help.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
background-color: var(--background-color-high-contrast);
55
padding: 1em;
66
max-width: 800px;
7-
line-height: 1.5;
7+
line-height: 1.25;
88
}
99

1010
.code {

ui/frontend/Icon.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22

3-
43
import * as styles from './Icon.module.css';
54

65
/* eslint-disable max-len */
@@ -24,7 +23,7 @@ export const ExpandableIcon = () => (
2423

2524
// M.D. 'more_horiz'
2625
export const MoreOptionsIcon = () => (
27-
<svg className={styles.icon} height="18" viewBox="0 0 24 24" width="18" opacity="0.5" xmlns="http://www.w3.org/2000/svg">
26+
<svg className={styles.icon} height="18" viewBox="0 0 24 24" width="18" xmlns="http://www.w3.org/2000/svg">
2827
<path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />
2928
</svg>
3029
);
@@ -38,20 +37,20 @@ export const MoreOptionsActiveIcon = () => (
3837

3938
// M.D. 'settings',
4039
export const ConfigIcon = () => (
41-
<svg className={styles.icon} height="15" viewBox="0 0 24 24" width="15" opacity="0.5" xmlns="http://www.w3.org/2000/svg">
40+
<svg className={styles.icon} height="15" viewBox="0 0 24 24" width="15" xmlns="http://www.w3.org/2000/svg">
4241
<path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z" />
4342
</svg>
4443
);
4544

4645
// M.D. 'help_outline'
4746
export const HelpIcon = () => (
48-
<svg className={styles.icon} height="18" viewBox="0 0 24 24" width="18" opacity="0.5" xmlns="http://www.w3.org/2000/svg">
47+
<svg className={styles.icon} height="18" viewBox="0 0 24 24" width="18" xmlns="http://www.w3.org/2000/svg">
4948
<path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z" />
5049
</svg>
5150
);
5251

5352
export const CheckmarkIcon = () => (
54-
<svg className={styles.icon} height="18" viewBox="2 2 22 22" width="18" opacity="0.5" xmlns="http://www.w3.org/2000/svg">
53+
<svg className={styles.icon} height="18" viewBox="2 2 22 22" width="18" xmlns="http://www.w3.org/2000/svg">
5554
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" />
5655
</svg>
5756
);

ui/frontend/Output.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
border: var(--border);
1717
border-right: none;
1818
background-color: var(--output-background-tab);
19-
line-height: 1.5em;
19+
line-height: 1.5;
2020

2121
&:last-of-type {
2222
border-right: var(--border);

ui/frontend/index.module.css

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,47 +103,62 @@
103103
/* Output tabs */
104104
--output-background-tab: #fcfcfc;
105105
--output-current-tab: #f9ffff;
106+
107+
/* Output compiler highlighting */
108+
--output-highlight-error-color: #bf1b1b;
109+
--output-highlight-warning-color: #f79a06;
106110
}
107111

108112
@define-mixin dark-theme-vars {
109113
--positive-luminance: black;
110114
--negative-luminance: white;
111115

112116
/* Fonts */
113-
--font-color: #b4aea6;
117+
--font-color: #dcdbd8;
114118
--font-color-high-contrast: #dcdbd8;
115119

116120
/* Links */
117-
--link-color: #308af2;
118-
--link-color-visited: #9f5fe1;
121+
--link-color: #b2dcff;
122+
--link-color-visited: #eecaff;
119123

120124
/* Background */
121-
--background-color: #292c2e;
122-
--background-color-high-contrast: #17191a;
125+
--background-color: #444;
126+
--background-color-high-contrast: #181818;
123127

124128
/* Code */
125129
--code-background-color: #3c3c3c;
126130

127131
/* Border */
128-
--border-color: #404548;
132+
--border-color: #5e5e5e;
129133

130134
/* Header */
131135
--header-main-border: #363b3d;
132136
--header-accent-border: #bdbdbd;
133137

134138
/* The big red button */
135139
--button-primary-color: #dcdbd8;
136-
--button-primary-bg-color: #81331a;
140+
--button-primary-bg-color: #5d2310;
137141
--button-primary-border-color: #612714;
138142

139143
/* Not the big red button */
140-
--button-secondary-color: #b4aea6;
144+
--button-secondary-color: #dcdbd8;
141145
--button-secondary-bg-color-top: #17191a;
142146
--button-secondary-bg-color-bottom: #1a1c1d;
147+
--button-secondary-border-color: color-mix(
148+
in hsl,
149+
var(--button-secondary-bg-color-bottom),
150+
var(--negative-luminance) 40%
151+
);
143152

144153
/* Output tabs */
145-
--output-background-tab: #191b1c;
146-
--output-current-tab: #343434;
154+
--output-background-tab: #343434;
155+
--output-current-tab: #191b1c;
156+
157+
/* Output compiler highlighting */
158+
--output-highlight-warning-color: #ffe800;
159+
--output-highlight-warning-bg-color: #330;
160+
--output-highlight-error-color: #f5f5f5;
161+
--output-highlight-error-bg-color: #820000;
147162
}
148163

149164
:root,
@@ -195,15 +210,18 @@ body {
195210
background-color: var(--background-color);
196211
padding: 0 1em;
197212
font-family: var(--primary-font);
213+
font-size: 18px;
198214
}
199215

200216
/* stylelint-disable-next-line selector-class-pattern */
201217
:global(.language-rust_errors) {
202218
& :global(.warning) {
203-
color: #f79a06;
219+
color: var(--output-highlight-warning-color);
220+
background-color: var(--output-highlight-warning-bg-color);
204221
}
205222

206223
& :global(.error) {
207-
color: #bf1b1b;
224+
color: var(--output-highlight-error-color);
225+
background-color: var(--output-highlight-error-bg-color);
208226
}
209227
}

ui/frontend/shared.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.-bodyMonospace {
2-
font-size: 0.9em;
2+
font-size: inherit;
3+
line-height: 1.25;
34

45
/* http://code.stephenmorley.org/html-and-css/fixing-browsers-broken-monospace-font-handling/
56
* ACE uses Monaco, Menlo, "Ubuntu Mono", Consolas, source-code-pro, monospace;

0 commit comments

Comments
 (0)