CSC-105

LibraryExample brief cards

Example brief cards

Paper tiles for finished Project 3 briefs. A card opens its source in the page overlay; the opened page uses the same filename chrome so it still looks like a project-brief.md.

Brief card

One example in the project grid. Query results supply href, title, kind, filename, and description. The link opens an overlay and still works as an ordinary page if JavaScript is off.

<a class="brief-card" href="{{ href }}" data-pmx-source-open="overlay">
  <span class="brief-card-bar">
    <code>{{ filename }}</code>
  </span>
  <span class="brief-card-body">
    <span class="brief-card-kind">{{ kind }}</span>
    <span class="brief-card-title">{{ title }}</span>
    <span class="brief-card-description">{{ description }}</span>
  </span>
</a>
.pmx-query-results[data-pmx-query-component="brief-card"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 1.5rem;
}

.brief-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-block-size: 11rem;
  overflow: clip;
  border: 1px solid var(--pmx-color-border);
  background: color-mix(
    in oklch,
    var(--pmx-color-surface) 72%,
    var(--pmx-color-bg)
  );
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.brief-card,
.brief-card:hover,
.brief-card:focus-visible,
.brief-card * {
  color: inherit;
  text-decoration: none;
}

.brief-card:hover,
.brief-card:focus-visible {
  border-color: var(--pmx-color-accent);
}

.brief-card:focus-visible {
  outline: 2px solid
    color-mix(in oklch, var(--pmx-color-accent) 40%, transparent);
  outline-offset: 2px;
}

.brief-card-bar {
  display: flex;
  align-items: center;
  min-inline-size: 0;
  padding: 0.45rem 0.7rem;
  border-block-end: 1px solid var(--pmx-color-border);
  background: var(--pmx-color-bg);
  font-family: var(--pmx-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--pmx-color-muted);
}

.brief-card-bar code {
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--pmx-color-accent);
  background: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-card-body {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding: 0.9rem 0.85rem 1rem;
}

.brief-card-kind {
  font-family: var(--pmx-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pmx-color-muted);
}

.brief-card-title {
  font-weight: 650;
  line-height: 1.25;
}

.brief-card-description {
  color: var(--pmx-color-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

@media (max-width: 40rem) {
  .pmx-query-results[data-pmx-query-component="brief-card"] {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brief-card {
    transition: none;
  }
}

Brief document

Filename chrome around a copyable Markdown source fence. Use it on an example brief so the overlay and the standalone page both look like a file.

<section class="brief-doc">
  <header class="brief-doc-bar">
    <code>{{ filename }}</code>
  </header>
  <div class="brief-doc-body">
    <slot />
  </div>
</section>
.brief-doc {
  display: grid;
  margin-block: 0;
  overflow: clip;
  border: 1px solid var(--pmx-color-border);
  background: color-mix(
    in oklch,
    var(--pmx-color-surface) 72%,
    var(--pmx-color-bg)
  );
  box-shadow: 0 1rem 2.5rem color-mix(in oklch, black 16%, transparent);
}

.brief-doc-bar {
  display: flex;
  align-items: center;
  min-inline-size: 0;
  padding: 0.55rem 0.85rem;
  border-block-end: 1px solid var(--pmx-color-border);
  background: var(--pmx-color-bg);
  font-family: var(--pmx-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--pmx-color-muted);
}

.brief-doc-bar code {
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--pmx-color-accent);
  background: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-doc-body {
  padding: 0.75rem 1rem 1rem;
}

.brief-doc-body > pre {
  margin: 0;
}

.brief-doc-body > :first-child {
  margin-block-start: 0;
}

.brief-doc-body > :last-child {
  margin-block-end: 0;
}