Skip to content

Commit 51bab59

Browse files
authored
Merge pull request rails#41000 from jonathanhefner/dark-mode-css
Tweak dark mode CSS
2 parents 059024e + b2db222 commit 51bab59

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,13 @@
5151
}
5252

5353
@media (prefers-color-scheme: dark) {
54-
body {
55-
background-color: #222;
56-
color: #ECECEC;
57-
}
58-
5954
#route_table tbody tr:nth-child(odd) {
60-
background: #333;
61-
}
62-
63-
#route_table tbody tr:nth-child(even) {
64-
background: #444;
55+
background: #282828;
6556
}
6657

67-
#route_table tbody.exact_matches,
68-
#route_table tbody.fuzzy_matches {
69-
color: #333;
58+
#route_table tbody.exact_matches tr,
59+
#route_table tbody.fuzzy_matches tr {
60+
background: DarkSlateGrey;
7061
}
7162
}
7263
<% end %>

railties/lib/rails/templates/layouts/application.html.erb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@
2525

2626
h2 { padding-left: 10px; }
2727

28+
@media (prefers-color-scheme: dark) {
29+
body {
30+
background-color: #222;
31+
color: #ececec;
32+
}
33+
34+
pre {
35+
background-color: #333;
36+
}
37+
38+
a { color: #fff; }
39+
a:visited { color: #999; }
40+
a:hover { color: #000; background-color: #fff; }
41+
}
42+
2843
<%= yield :style %>
2944
</style>
3045
</head>

0 commit comments

Comments
 (0)