|
1 | | -// In dark mode the footer sits on the repo's canvas (#0d1117) while brand's |
2 | | -// canvas-subtle comes from brand's own palette (#0f1511). Those are near-identical, |
3 | | -// so the controls would lose their fill and read as bare outlines. Use Primer's |
4 | | -// surfaces there instead: they're built to contrast with this background. Selector |
5 | | -// pattern follows octicon-table-optimization.scss. |
6 | | -@mixin footer-control-surfaces-dark { |
7 | | - --color-btn-bg: var(--color-canvas-subtle); |
8 | | - --color-btn-border: var(--color-border-default); |
9 | | - --color-btn-text: var(--color-fg-default); |
10 | | - --brand-footer-backToTop-bgColor-rest: var(--color-canvas-subtle); |
11 | | - // Brand's own dark border token is a different grey from Primer's, which would |
12 | | - // leave Back to top outlined differently from the three buttons beside it. |
13 | | - --brand-footer-backToTop-borderColor-rest: var(--color-border-default); |
14 | | -} |
15 | | - |
16 | 1 | .docsFooter { |
17 | 2 | // Brand defaults the footer to canvas-subtle (a grey panel); the design puts it on |
18 | 3 | // the page canvas so it reads as continuous with the article and the band above. |
19 | | - // Deliberately the *repo's* canvas, not brand's: brand's canvas-default is pure |
20 | | - // black in dark mode while these pages sit on #0d1117, which would make the footer |
21 | | - // a visibly darker slab. |
22 | | - --brand-footer-bg-color: var(--bgColor-default, var(--color-canvas-default)); |
| 4 | + // Brand's canvas, not Primer's: every other painted element in here is brand, and |
| 5 | + // `--bgColor-default` is undefined in this app so the old value fell through to |
| 6 | + // Primer's blue-tinted #0d1117 in dark mode. |
| 7 | + --brand-footer-bg-color: var(--brand-color-canvas-default); |
23 | 8 |
|
24 | 9 | // The design draws all four footer controls (Yes, No, Make a contribution and |
25 | 10 | // Back to top) on brand's subtle canvas with a subtle border (#f2f5f3 on #d2d9d4, |
|
29 | 14 | // read rather than overriding the rules: the survey's selected states apply |
30 | 15 | // `color-bg-success-emphasis` / `color-bg-danger-emphasis`, which set |
31 | 16 | // background-color directly and must keep winning over the rest state. |
| 17 | + // |
| 18 | + // BOTH spellings are required. @primer/css declares the button like this: |
| 19 | + // border-color: var(--button-default-borderColor-rest, var(--color-btn-border)); |
| 20 | + // The legacy `--color-btn-*` names are only the FALLBACK. They used to win because |
| 21 | + // the `--button-default-*` names were undefined in this app, but index.scss now |
| 22 | + // imports the Primer Primitives functional themes, which define them — so setting |
| 23 | + // only the legacy names would silently lose to Primer's palette (#3d444d borders |
| 24 | + // in dark). Setting the modern names is what actually takes effect; the legacy |
| 25 | + // ones are kept so this still works if the functional themes are ever dropped. |
| 26 | + --button-default-bgColor-rest: var(--brand-color-canvas-subtle); |
| 27 | + --button-default-borderColor-rest: var(--brand-color-border-subtle); |
| 28 | + --button-default-fgColor-rest: var(--brand-color-text-default); |
32 | 29 | --color-btn-bg: var(--brand-color-canvas-subtle); |
33 | 30 | --color-btn-border: var(--brand-color-border-subtle); |
34 | 31 | --color-btn-text: var(--brand-color-text-default); |
|
37 | 34 | // the same treatment as the other three. Its border already matches. |
38 | 35 | --brand-footer-backToTop-bgColor-rest: var(--brand-color-canvas-subtle); |
39 | 36 |
|
40 | | - :global([data-color-mode="dark"]) & { |
41 | | - @include footer-control-surfaces-dark; |
42 | | - } |
43 | | - |
44 | | - @media (prefers-color-scheme: dark) { |
45 | | - :global([data-color-mode="auto"][data-dark-theme*="dark"]) & { |
46 | | - @include footer-control-surfaces-dark; |
47 | | - } |
48 | | - } |
49 | | - |
50 | 37 | // The band above supplies the visual break, and the design puts a 2px emphasized |
51 | 38 | // rule directly beneath it, on the footer's own top edge. Brand's default here is |
52 | 39 | // a much brighter green (scale-green-3), so this stays an explicit override. |
|
132 | 119 | .copyrightText { |
133 | 120 | order: 2; |
134 | 121 | padding: var(--base-size-20); |
135 | | - border-top: 1px solid |
136 | | - var(--borderColor-muted, var(--color-border-muted, #d2d9d4)); |
| 122 | + border-top: 1px solid var(--brand-color-border-subtle); |
137 | 123 | } |
138 | 124 | } |
139 | 125 |
|
|
174 | 160 |
|
175 | 161 | // KO law requires the privacy statement link to be conspicuous. |
176 | 162 | &[data-conspicuous="true"] { |
177 | | - color: var(--fgColor-attention, var(--color-fg-attention, #9a6700)); |
| 163 | + // Brand ships no attention token, so this chains to Primer's — but the old name |
| 164 | + // is `--color-attention-fg`; spelled `--color-fg-attention` nothing in the chain |
| 165 | + // resolved and the hardcoded light amber won in dark mode too. |
| 166 | + color: var(--fgColor-attention, var(--color-attention-fg)); |
178 | 167 | font-weight: 600; |
179 | 168 | } |
180 | 169 | } |
0 commit comments