open-navigator / web_app /src /styles /home-topic-bar.css
jcbowyer's picture
Clean HuggingFace deployment without binary files
d15f07c
Raw History Blame Contribute Delete
3.98 kB
/* The home topic switcher (#1350): a compact, sideways-scrolling chip row above the hero headline. */
.home-tbar {
position: relative;
margin: 0 0 6px;
min-height: 44px;
}
.home-tbar-scroll {
display: flex;
align-items: center;
gap: 8px;
overflow-x: auto;
padding: 3px 28px 3px 2px;
scrollbar-width: none;
-webkit-overflow-scrolling: touch;
}
.home-tbar-scroll::-webkit-scrollbar {
display: none;
}
.home-tbar-list {
display: flex;
gap: 8px;
}
.home-tbar-tail {
display: flex;
flex: none;
align-items: center;
gap: 8px;
}
.home-tbar-chip {
flex: none;
display: inline-flex;
align-items: center;
min-height: 36px;
padding: 0 14px;
border-radius: 999px;
border: 1px solid #d6d3d1;
background: #fff;
color: #44403c;
font: inherit;
font-size: 14px;
font-weight: 600;
white-space: nowrap;
text-decoration: none;
cursor: pointer;
}
.home-tbar-chip:hover {
background: #f0fdfa;
border-color: #0f766e;
color: #0f766e;
}
.home-tbar-chip.is-on,
.home-tbar-chip.is-on:hover {
background: #0f766e;
border-color: #0f766e;
color: #fff;
}
.home-tbar-chip.is-all {
border-style: dashed;
color: #0f766e;
}
.home-tbar-chip:focus-visible {
outline: 3px solid #0f766e;
outline-offset: 2px;
}
/* The fade on the right edge says "more this way"; it goes once the row is scrolled to its end. */
.home-tbar::after {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 32px;
pointer-events: none;
background: linear-gradient(to right, rgba(250, 250, 249, 0), #fafaf9);
transition: opacity 120ms;
}
.home-tbar[data-at-end]::after {
opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
.home-tbar::after {
transition: none;
}
}
/* #1416: badges and the live-story dot on a pill. */
.home-tbar-dot {
width: 6px;
height: 6px;
margin-right: 7px;
border-radius: 50%;
background: #0f766e;
flex: none;
}
.home-tbar-chip.is-on .home-tbar-dot {
background: #fff;
}
.home-tbar-badges {
display: inline-flex;
gap: 3px;
margin-left: 6px;
font-size: 11px;
line-height: 1;
}
.home-tbar-badges [data-badge='rising'] {
color: #0f766e;
}
.home-tbar-chip.is-on .home-tbar-badges [data-badge='rising'] {
color: #ccfbf1;
}
.home-tbar-chip.is-pending {
animation: home-tbar-pulse 900ms ease-in-out infinite alternate;
}
@keyframes home-tbar-pulse {
from {
opacity: 1;
}
to {
opacity: 0.72;
}
}
.home-tbar-chip.is-more {
border-style: solid;
color: #44403c;
}
/* Desktop: the pills wrap to at most two rows; More opens the rest. Phones keep the one scrolling row above. */
@media (min-width: 768px) {
.home-tbar::after {
display: none;
}
.home-tbar-scroll {
overflow: visible;
align-items: flex-start;
padding-right: 2px;
}
.home-tbar-list {
flex: 1 1 auto;
flex-wrap: wrap;
min-width: 0;
/* two rows of 36px pills, one 8px gap, and room for the focus ring */
max-height: 86px;
overflow: hidden;
padding: 3px 3px;
margin: -3px;
}
.home-tbar[data-expanded] .home-tbar-list {
max-height: none;
overflow: visible;
}
.home-tbar-tail {
align-self: flex-end;
padding-bottom: 0;
}
}
@media (max-width: 767px) {
.home-tbar-tail {
padding-right: 4px;
}
}
@media (prefers-reduced-motion: reduce) {
.home-tbar-chip.is-pending {
animation: none;
opacity: 0.8;
}
}
/* #1416: a switched topic's text fades in under the box flight; with reduced motion the whole card crossfades instead. */
@keyframes home-card-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.home-story-card .home-story-text {
animation: home-card-in 180ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
.home-story-card {
animation: home-card-in 220ms ease-out;
}
.home-story-card .home-story-text {
animation: none;
}
}
@media (prefers-reduced-motion: reduce) {
.home-story-map[data-xfade] {
animation: home-card-in 220ms ease-out;
}
}