Skip to content

Commit 112d683

Browse files
committed
merge: docs dark mode contrast
2 parents 6de0b88 + 19dfd99 commit 112d683

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

docs/stylesheets/extra.css

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
--admincraft-dirt: #805539;
33
--admincraft-grass: #5f7f3b;
44
--admincraft-ink: #252018;
5-
--md-primary-fg-color: #6f4933;
6-
--md-primary-fg-color--light: #94684a;
7-
--md-primary-fg-color--dark: #4b3022;
8-
--md-accent-fg-color: #658746;
5+
--admincraft-sand: #e3d3bd;
96
}
107

118
/* Tint Material's own schemes rather than declaring new ones.
@@ -19,6 +16,13 @@
1916
--md-default-bg-color: #fbf9f4;
2017
--md-default-fg-color: var(--admincraft-ink);
2118
--md-code-bg-color: #eee9dd;
19+
/* These sat on :root, where Material's own scheme block outranked them, so
20+
* light mode kept the stock indigo for links and buttons under a brown and
21+
* green header. They have to be set on the scheme itself to take. */
22+
--md-primary-fg-color: #6f4933;
23+
--md-primary-fg-color--light: #94684a;
24+
--md-primary-fg-color--dark: #4b3022;
25+
--md-accent-fg-color: #658746;
2226
}
2327

2428
[data-md-color-scheme="slate"] {
@@ -93,6 +97,22 @@
9397
border-color: var(--admincraft-grass) !important;
9498
}
9599

100+
/* An outlined button takes its text and border from --md-primary-fg-color,
101+
* which is the header colour. That is a dark brown here, so on the dark page
102+
* the secondary button sat at 1.7:1 against its own background: drawn, but not
103+
* visible. Material's hover then paints it with the accent and writes on it in
104+
* --md-accent-bg-color, which slate leaves as white, giving 2.1:1 on light
105+
* green. Both need a foreground chosen for this background rather than
106+
* inherited from the header. */
107+
[data-md-color-scheme="slate"] .md-button {
108+
color: var(--admincraft-sand);
109+
}
110+
111+
[data-md-color-scheme="slate"] .md-button:focus,
112+
[data-md-color-scheme="slate"] .md-button:hover {
113+
color: var(--admincraft-ink);
114+
}
115+
96116
@media (max-width: 44.9844em) {
97117
.admincraft-hero {
98118
padding: 1.5rem 1rem;

0 commit comments

Comments
 (0)