Skip to content

Incremental engine for long horizon agents 🌟 Star if you like it!

922 B
Raw Blame
---
// Colors a βœ“ or βœ— in a comparison table: `<Mark good>βœ“</Mark>` is green,
// `<Mark bad>βœ—</Mark>` is pink. The glyph is typed in the page, not drawn
// here, so that the Markdown twin of the page keeps it. A cell that starts
// with a mark hangs its text: a wrapped line starts under the text, not under
// the mark.
interface Props {
  good?: boolean;
  bad?: boolean;
}
const { good = false, bad = false } = Astro.props;
---
<span class:list={['mark', { 'mark--good': good, 'mark--bad': bad }]}><slot /></span>

<style>
  .mark { display: inline-block; width: 1.25em; font-weight: 600; text-indent: 0; }
  /* 14px is the cell's own left padding (site.css). The mark and the space
     after it take 1.5em. */
  :global(.prose td:has(> .mark:first-child)) {
    padding-left: calc(14px + 1.5em);
    text-indent: -1.5em;
  }
  .mark--good { color: var(--palm); }
  .mark--bad { color: var(--pink); }
</style>