Skip to content

Commit 8656f30

Browse files
authored
fix(site): keep the Like letters? bar's look when the announcement banner is off (#63157)
1 parent 7aa3be1 commit 8656f30

2 files changed

Lines changed: 87 additions & 86 deletions

File tree

‎services/site/src/component/site/site-banner.css‎

Lines changed: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
/* × at the right end, centred on the GitHub mark's vertical line below it: the fixed corner
7676
mark beside the sidebar and on bare pages; on small screens the top bar's mark, left of the
7777
menu button (the button ends 2rem in from the page edge, the mark sits 0.5rem before it).
78-
A 40px target, in the body colour (the shared styles below). */
78+
A 40px target, in the body colour (the blue bars' shared styles, site.css). */
7979
[data-slot="dismiss"] {
8080
position: absolute;
8181
--dismiss-centre: calc(var(--github-right, 1.5rem) + var(--github-size, 2.5rem) / 2);
@@ -102,89 +102,6 @@
102102
}
103103
}
104104

105-
/* The two blue bars, the announcement banner above and the footer's letters bar (site.css), share
106-
one look: a highlight in solid white ("NEW", "Like letters?") and a body at 92% white (the message
107-
or the font line, with its chevron, and the banner's ×), 4.5:1 on the blue. Hover and keyboard
108-
focus bring the body to full white in 150ms and nudge the chevron 2px right; focus adds a white
109-
ring inset in the bar; a press dims the blue a little. */
110-
:is([data-component="letters-bar"], [data-component="announcement-banner"]) {
111-
--bar-highlight: #fff;
112-
--bar-body: rgb(255 255 255 / 0.92);
113-
114-
a {
115-
color: var(--bar-highlight);
116-
}
117-
118-
[data-slot="body"] {
119-
display: inline-flex;
120-
align-items: center;
121-
gap: 0.25rem;
122-
min-width: 0;
123-
color: var(--bar-body);
124-
transition: color 150ms ease;
125-
}
126-
127-
/* The home announcement's light chevron (icons.tsx), drawn for 13px text, scaled to the 15px
128-
text (10/13 em) with its stroke kept at 1px. */
129-
[data-slot="chevron-right"] {
130-
flex-shrink: 0;
131-
width: calc(1em * 10 / 13);
132-
height: calc(1em * 10 / 13);
133-
transition: translate 150ms var(--ease-out, ease-out);
134-
135-
path {
136-
vector-effect: non-scaling-stroke;
137-
}
138-
}
139-
140-
[data-slot="dismiss"] {
141-
color: var(--bar-body);
142-
transition: color 150ms ease;
143-
}
144-
145-
@media (hover: hover) and (pointer: fine) {
146-
a:hover [data-slot="body"],
147-
[data-slot="dismiss"]:hover {
148-
color: var(--bar-highlight);
149-
}
150-
151-
a:hover [data-slot="chevron-right"] {
152-
translate: calc(2px * var(--x-dir, 1)) 0;
153-
}
154-
}
155-
156-
a:focus-visible [data-slot="body"],
157-
[data-slot="dismiss"]:focus-visible {
158-
color: var(--bar-highlight);
159-
}
160-
161-
a:focus-visible [data-slot="chevron-right"] {
162-
translate: calc(2px * var(--x-dir, 1)) 0;
163-
}
164-
165-
a:focus-visible {
166-
outline: 2px solid var(--bar-highlight);
167-
outline-offset: -6px;
168-
}
169-
170-
[data-slot="dismiss"]:focus-visible {
171-
outline: 2px solid var(--bar-highlight);
172-
outline-offset: -8px;
173-
}
174-
175-
a:active {
176-
background-color: color-mix(in srgb, var(--bar-blue) 90%, #000);
177-
}
178-
179-
@media (prefers-reduced-motion: reduce) {
180-
[data-slot="body"],
181-
[data-slot="chevron-right"],
182-
[data-slot="dismiss"] {
183-
transition: none;
184-
}
185-
}
186-
}
187-
188105
/* Small screens: the content starts on the page edge and stops short of the ×, which moves over
189106
the top bar's GitHub mark (bare pages keep the corner mark). */
190107
@media (max-width: 60rem) {

‎services/site/src/component/site/site.css‎

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3337,11 +3337,95 @@ html:has([data-site][data-theme="dark"]) {
33373337
}
33383338
}
33393339

3340+
/* The two blue bars, the announcement banner above and the footer's letters bar, share
3341+
one look: a highlight in solid white ("NEW", "Like letters?") and a body at 92% white (the message
3342+
or the font line, with its chevron, and the banner's ×), 4.5:1 on the blue. Hover and keyboard
3343+
focus bring the body to full white in 150ms and nudge the chevron 2px right; focus adds a white
3344+
ring inset in the bar; a press dims the blue a little. Here in the shell, not in site-banner.css,
3345+
which production leaves out while the banner is off. */
3346+
:is([data-component="letters-bar"], [data-component="announcement-banner"]) {
3347+
--bar-highlight: #fff;
3348+
--bar-body: rgb(255 255 255 / 0.92);
3349+
3350+
a {
3351+
color: var(--bar-highlight);
3352+
}
3353+
3354+
[data-slot="body"] {
3355+
display: inline-flex;
3356+
align-items: center;
3357+
gap: 0.25rem;
3358+
min-width: 0;
3359+
color: var(--bar-body);
3360+
transition: color 150ms ease;
3361+
}
3362+
3363+
/* The home announcement's light chevron (icons.tsx), drawn for 13px text, scaled to the 15px
3364+
text (10/13 em) with its stroke kept at 1px. */
3365+
[data-slot="chevron-right"] {
3366+
flex-shrink: 0;
3367+
width: calc(1em * 10 / 13);
3368+
height: calc(1em * 10 / 13);
3369+
transition: translate 150ms var(--ease-out, ease-out);
3370+
3371+
path {
3372+
vector-effect: non-scaling-stroke;
3373+
}
3374+
}
3375+
3376+
[data-slot="dismiss"] {
3377+
color: var(--bar-body);
3378+
transition: color 150ms ease;
3379+
}
3380+
3381+
@media (hover: hover) and (pointer: fine) {
3382+
a:hover [data-slot="body"],
3383+
[data-slot="dismiss"]:hover {
3384+
color: var(--bar-highlight);
3385+
}
3386+
3387+
a:hover [data-slot="chevron-right"] {
3388+
translate: calc(2px * var(--x-dir, 1)) 0;
3389+
}
3390+
}
3391+
3392+
a:focus-visible [data-slot="body"],
3393+
[data-slot="dismiss"]:focus-visible {
3394+
color: var(--bar-highlight);
3395+
}
3396+
3397+
a:focus-visible [data-slot="chevron-right"] {
3398+
translate: calc(2px * var(--x-dir, 1)) 0;
3399+
}
3400+
3401+
a:focus-visible {
3402+
outline: 2px solid var(--bar-highlight);
3403+
outline-offset: -6px;
3404+
}
3405+
3406+
[data-slot="dismiss"]:focus-visible {
3407+
outline: 2px solid var(--bar-highlight);
3408+
outline-offset: -8px;
3409+
}
3410+
3411+
a:active {
3412+
background-color: color-mix(in srgb, var(--bar-blue) 90%, #000);
3413+
}
3414+
3415+
@media (prefers-reduced-motion: reduce) {
3416+
[data-slot="body"],
3417+
[data-slot="chevron-right"],
3418+
[data-slot="dismiss"] {
3419+
transition: none;
3420+
}
3421+
}
3422+
}
3423+
33403424
/* "Like letters?": a full-width blue bar at the very end of the page (after the footer, in the flow),
33413425
which grows open and pushes the page up while the wordmark's letters are out of order. */
33423426
[data-site] {
33433427
--letters-bar-height: 3.25rem;
3344-
/* The blue bars' shared look (site-banner.css): the link blue, the same as the blue buttons and
3428+
/* The blue bars' shared look (above): the link blue, the same as the blue buttons and
33453429
the announcement banner (dark mode keeps the deeper light-mode blue, so white keeps 4.5:1). */
33463430
--bar-blue: light-dark(var(--link), #3b5cf6);
33473431
}
@@ -3405,7 +3489,7 @@ html:has([data-site][data-theme="dark"]) {
34053489
gap: 0.25rem;
34063490
height: calc(var(--letters-bar-height) + env(safe-area-inset-bottom, 0px));
34073491
padding-bottom: env(safe-area-inset-bottom, 0px);
3408-
/* The blue bars' shared look (--bar-blue above, site-banner.css): a highlight and a 92% body. */
3492+
/* The blue bars' shared look (--bar-blue and the shared rules above): a highlight and a 92% body. */
34093493
background: var(--bar-blue);
34103494
font-family: var(--font-sans);
34113495
font-size: var(--fs-ui);

0 commit comments

Comments
 (0)