Skip to content

The Open Standard for Generative UI

4.0 KB
Raw Blame
.race {
  box-sizing: border-box;
  width: 100%;
  padding: 1rem 1.25rem 0.875rem;
  border: 1px solid var(--openui-border-default);
  border-radius: 18px;
  background: var(--openui-background);
  font-family: var(--home-font-text, "Inter", sans-serif);
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--openui-text-neutral-secondary);
}

.replay {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--openui-border-default);
  border-radius: 999px;
  background: transparent;
  color: var(--openui-text-neutral-primary);
  cursor: pointer;
}

.replay:disabled {
  opacity: 0.3;
  cursor: default;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
}

.name {
  font-weight: 600;
  color: var(--openui-text-neutral-secondary);
}

.barOpenui .name {
  color: var(--openui-text-neutral-primary);
}

.note {
  font-weight: 400;
  color: var(--openui-text-neutral-tertiary, var(--openui-text-neutral-secondary));
}

.count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--openui-text-neutral-secondary);
}

.barOpenui .count {
  color: var(--openui-text-neutral-primary);
  font-weight: 600;
}

.status {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 5.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--openui-text-neutral-primary);
  color: var(--openui-background);
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  animation: pop 360ms cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.done {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--openui-text-neutral-secondary);
  animation: pop 300ms ease both;
}

.working {
  font-family: var(--home-font-mono, ui-monospace, monospace);
  font-size: 0.6875rem;
  color: var(--openui-text-neutral-tertiary, var(--openui-text-neutral-secondary));
  animation: blink 1s steps(2) infinite;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

/* ── The block bar ── */

/* Every bar has the same number of slots, so the bars line up and the empty
   slots past OpenUI's last block show how much it never needed. */
.track {
  display: grid;
  grid-template-columns: repeat(var(--slots), minmax(0, 1fr));
  gap: 3px;
}

.slot {
  height: 14px;
  border-radius: 3px;
  background: var(--openui-foreground);
  box-shadow: inset 0 0 0 1px var(--openui-border-default);
}

/* Past the end of this format's output: no outline, so the bar visibly stops. */
.slotUnused {
  background: transparent;
  box-shadow: inset 0 0 0 1px transparent;
  background-image: radial-gradient(circle, var(--openui-border-default) 1px, transparent 1.5px);
  background-size: 100% 100%;
}

.block {
  background: var(--openui-text-neutral-secondary);
  opacity: 0.5;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.15);
  animation: land 260ms cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.barOpenui .block {
  background: var(--openui-text-neutral-primary);
  opacity: 1;
}

/* Each block snaps in from the left with a little overshoot. */
@keyframes land {
  from {
    opacity: 0;
    transform: translateX(-8px) scale(0.6);
  }
}

.foot {
  margin: 0.875rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--openui-text-neutral-tertiary, var(--openui-text-neutral-secondary));
}

@media (prefers-reduced-motion: reduce) {
  .block,
  .badge,
  .done,
  .working {
    animation: none;
  }
}

@media (max-width: 480px) {
  .race {
    padding-inline: 0.875rem;
  }

  .track {
    gap: 2px;
  }

  .slot {
    height: 11px;
    border-radius: 2px;
  }

  .status {
    min-width: 4.5rem;
  }
}