Skip to content

The Open Standard for Generative UI

7.4 KB
Raw Blame
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.desktopActions {
  display: none;
  align-items: center;
}

.hamburgerIcon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Header end on mobile: theme toggle sits beside the menu/close button. */
.mobileEndActions {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.mobileMenuButton {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--openui-text-neutral-primary);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mobileMenuButton:hover,
.mobileTrayLink:hover {
  background: var(--openui-highlight);
}

.mobileBackdrop {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  height: 100vh;
  cursor: pointer;
  background: rgb(0 0 0 / 60%);
  backdrop-filter: blur(12px);
}

.mobileTrayWrap {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none;
}

.mobileTray {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  /* Everything below the header, so the tray is the whole screen rather than a
     panel hanging off the top of it. dvh rather than vh: on mobile the browser's
     own chrome moves, and vh would put the footer under it.

     The offset mirrors --site-header-row-min-height in site-header.module.css.
     It is copied rather than referenced because the tray renders outside
     .surface and so does not inherit it; keep the two in step by hand. */
  height: calc(100dvh - 4rem);
  max-height: calc(100dvh - 4rem);
  overflow-y: auto;
  border-top: 1px solid var(--openui-border-default);
  background: var(--openui-foreground);
  box-shadow: var(--openui-shadow-xl);
}

/* Match the top bar: pure black in dark mode (the foreground token is only dark gray). */
[data-theme="dark"] .mobileTray {
  background: #000;
}

/* Brighter, less-muddy blurred backdrop in dark mode. */
[data-theme="dark"] .mobileBackdrop {
  background: rgb(255 255 255 / 0.1);
}

.mobileTrayInner {
  display: flex;
  width: 100%;
  min-height: 100%;
  max-width: 75rem;
  margin-inline: auto;
  flex-direction: column;
  /* The filled title bars separate the sections now, so they can sit close. */
  gap: 0.375rem;
  padding: 0.5rem 1.25rem 1rem;
}

.mobileTraySection {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-block: 0.125rem;
}

/* A filled bar rather than a bare label, so a collapsed section still reads as
   something you can open. The same element serves both kinds: Product renders it
   as a div with no chevron, the rest as a button with one. */
.mobileTraySectionHeading {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  padding: 0.8125rem 0.75rem;
  border: 0;
  border-radius: 0.625rem;
  background: rgba(10, 10, 10, 0.04);
  font-family: "Inter", sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: left;
  text-transform: none;
  color: var(--openui-text-neutral-secondary);
}

[data-theme="dark"] .mobileTraySectionHeading {
  background: rgba(255, 255, 255, 0.06);
}

.mobileTraySectionHeading {
  cursor: pointer;
}

.mobileTrayChevron {
  flex: none;
  opacity: 0.7;
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}

.mobileTrayChevronOpen {
  transform: rotate(180deg);
}

/* Clipped so the height animation has something to reveal. */
.mobileTraySectionItems {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow: hidden;
}

.mobileTrayDivider {
  height: 1px;
  margin-inline: 0.75rem;
  background: var(--openui-border-default);
}

.mobileTrayLink {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 3rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6875rem 0.625rem;
  border-radius: 0.375rem;
  color: var(--openui-text-neutral-primary);
  text-align: left;
  text-decoration: none;
  transition: background-color 0.2s ease;
  font-family: "Inter Display", sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Matches .badge in the primary nav: same job, same neutral, same dark rule. */
/* A hairline between adjacent items only. Not under the section titles and not
   below the last item: the filled title bars already divide the sections, so a
   rule there would be saying it twice. Sits in the 2px gap between rows, inset
   to the item's own padding so it lines up with the text. */
.mobileTrayLink + .mobileTrayLink::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 0.625rem;
  left: 0.625rem;
  height: 1px;
  background: rgba(10, 10, 10, 0.07);
}

[data-theme="dark"] .mobileTrayLink + .mobileTrayLink::before {
  background: rgba(255, 255, 255, 0.08);
}

/* Same chip as .mobileTrayBadge below: solid and inverted. */
.mobileTrayComingSoon {
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: #0a0a0a;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

[data-theme="dark"] .mobileTrayComingSoon {
  background: #f3f3f4;
  color: #0d0d0f;
}

.mobileTrayLinkMuted {
  cursor: default;
}

.mobileTrayLinkMuted > span:first-child {
  opacity: 0.55;
}

.mobileTrayBadge {
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: #0a0a0a;
  color: #ffffff;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

[data-theme="dark"] .mobileTrayBadge {
  background: #f3f3f4;
  color: #0d0d0f;
}

/* GitHub button pinned to the bottom of the mobile tray, separated like a section. */
/* Docs and GitHub side by side, as two equal buttons. */
.mobileTrayFooter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
  /* Takes up the slack, so the buttons sit at the bottom of the screen when the
     sections are collapsed. Sticky, so they stay there when open sections make
     the tray scroll. The negative margin cancels .mobileTrayInner's bottom
     padding, so the footer's own background covers the gap under it. */
  position: sticky;
  bottom: 0;
  margin-top: auto;
  margin-bottom: -1rem;
  padding-block: 1rem;
  border-top: 1px solid var(--openui-border-default);
  background: var(--openui-foreground);
}

[data-theme="dark"] .mobileTrayFooter {
  background: #000;
}

/* Docs: a secondary button beside the primary GitHub one. Same size and shape as
   the compact GitHub pill; colours from the site's secondary pill
   (.pillSecondary in Button.module.css), which follow the theme tokens. */
.mobileTrayDocsLink {
  box-sizing: border-box;
  display: inline-flex;
  height: 2.5rem;
  align-items: center;
  gap: 0.375rem;
  padding-inline: 0.875rem;
  border: 1px solid var(--openui-border-default);
  border-radius: 999px;
  background: var(--openui-foreground);
  box-shadow: var(--openui-shadow-l);
  color: var(--openui-text-neutral-primary);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

/* Both buttons fill their column, contents centred. */
.mobileTrayFooter a {
  width: 100%;
  justify-content: center;
}

@media (min-width: 1024px) {
  .desktopActions {
    display: flex;
  }

  .mobileEndActions,
  .mobileBackdrop,
  .mobileTrayWrap {
    display: none;
  }
}