Skip to content

The Open Standard for Generative UI

3.1 KB
Raw Blame
/* Monochrome, like the rest of the site: the accent is the primary text
   colour, with translucent steps of it for fills. */
.card {
  --compare-accent: var(--openui-text-neutral-primary);
  --compare-accent-soft: rgba(0, 0, 0, 0.06);
  --compare-accent-muted: rgba(0, 0, 0, 0.22);

  font-family: var(--home-font-text, "Inter", sans-serif);
  color: var(--openui-text-neutral-primary);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
  max-width: 420px;
  height: fit-content;
  padding: 1rem;
  border: 1px solid var(--openui-border-default);
  border-radius: 14px;
  background: var(--openui-foreground);
  box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .card {
  --compare-accent-soft: rgba(255, 255, 255, 0.1);
  --compare-accent-muted: rgba(255, 255, 255, 0.3);
}

.cardHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.cardTitle {
  font-size: 0.9375rem;
  font-weight: 600;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--openui-border-default);
  border-radius: 10px;
}

.kpiLabel {
  font-size: 0.6875rem;
  color: var(--openui-text-neutral-secondary);
}

.kpiValue {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kpiDelta {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #16a34a;
}

[data-theme="dark"] .kpiDelta {
  color: #4ade80;
}

.chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  height: 130px;
  padding-top: 1.25rem;
}

.barGroup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  min-height: 0;
  cursor: default;
}

.bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex: 1;
  width: 100%;
  min-height: 0;
}

.bar {
  width: 44%;
  max-width: 34px;
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  animation: grow 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: opacity 150ms;
}

.barSales {
  background: var(--compare-accent);
  animation-delay: 80ms;
}

.chart:hover .barGroup:not(.barGroupHover) .bar {
  opacity: 0.4;
}

@keyframes grow {
  from {
    transform: scaleY(0);
  }
}

.barLabel {
  font-size: 0.6875rem;
  color: var(--openui-text-neutral-secondary);
  white-space: nowrap;
}

.barTip {
  position: absolute;
  top: -1.25rem;
  padding: 0.125rem 0.375rem;
  border-radius: 6px;
  background: var(--openui-text-neutral-primary);
  color: var(--openui-background);
  font-size: 0.6875rem;
  white-space: nowrap;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .bar {
    animation: none;
  }
}

/* Step 2's Button, rendered. */
.action {
  align-self: flex-start;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--openui-border-default);
  border-radius: 10px;
  background: var(--openui-background);
  color: var(--openui-text-neutral-primary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.action:hover {
  border-color: var(--openui-text-neutral-primary);
}