feat: the plugin listing, built from registry data
One YAML file per plugin. There is deliberately no version and no runtimes field in an entry: both are read from npm and JSR when the page is built, so a card cannot go stale or claim support a package never declared. The strictness lives in one flag. Under CI a registry that does not answer fails the build, because a listing that silently drops a plugin is worse than no deploy. Locally an unpublished package falls back to scripts/preview.mjs and says so — a site nobody can look at until its packages ship is a site nobody can design. The three seed plugins are unpublished today, so that fallback is what renders them; it goes away with them. Every card shows all four runtimes, never only the supported ones. Colour means the package declares it runs there, dim grey means it does not — and the tooltip is what separates "declared unsupported" from "nobody said", which look identical but are not the same fact. The brand marks carry no <title>: an SVG's own title wins over its parent's, which is why the first attempt showed a help cursor and no tooltip. They are aria-hidden and pointer-events: none, so the label and the hover both belong to the list item, and the tooltip works from the keyboard too. Type and palette are self-hosted from green-tea-site, so the sites read as one project rather than three that share a colour. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
24 files changed
+5203
No files matched your search
@@ -0,0 +1,83 @@
|
||||
---
|
||||
import { RUNTIMES } from '../../scripts/registry.mjs';
|
||||
// Brand marks from simple-icons (CC0), vendored rather than pulled at build time. `?raw` inlines
|
||||
// them so each is one path in the HTML instead of four more requests.
|
||||
import node from '../icons/nodedotjs.svg?raw';
|
||||
import deno from '../icons/deno.svg?raw';
|
||||
import bun from '../icons/bun.svg?raw';
|
||||
import workerd from '../icons/cloudflareworkers.svg?raw';
|
||||
|
||||
interface Props {
|
||||
name: string;
|
||||
description: string;
|
||||
repo: string;
|
||||
version: string;
|
||||
npm?: string;
|
||||
jsr?: string;
|
||||
runtimes: string[];
|
||||
internal: boolean;
|
||||
}
|
||||
|
||||
const { name, description, repo, version, npm, jsr, runtimes, internal } = Astro.props;
|
||||
|
||||
const ICONS: Record<string, string> = { node, deno, bun, workerd };
|
||||
const LABELS: Record<string, string> = {
|
||||
node: 'Node.js',
|
||||
deno: 'Deno',
|
||||
bun: 'Bun',
|
||||
workerd: 'workerd (Cloudflare Workers)',
|
||||
};
|
||||
|
||||
// All four are always shown. Colour means the package declares it runs there; dim grey means it
|
||||
// declared otherwise, or said nothing — the tooltip is what separates those two, because at a
|
||||
// glance they are the same fact: you cannot use it there.
|
||||
const runs = (runtime: string) => runtimes.includes(runtime);
|
||||
const tooltip = (runtime: string) => {
|
||||
if (runs(runtime)) return `Runs on ${LABELS[runtime]}`;
|
||||
|
||||
return internal
|
||||
? `Does not run on ${LABELS[runtime]} — see the README for why`
|
||||
: `${LABELS[runtime]} not declared by this package`;
|
||||
};
|
||||
---
|
||||
|
||||
<article class="card">
|
||||
<span class="version">{version}</span>
|
||||
<h2>{name}</h2>
|
||||
|
||||
<ul class="runtimes">
|
||||
{
|
||||
RUNTIMES.map((runtime) => (
|
||||
// `data-tip` rather than `title`: the native tooltip waits about a second, cannot be
|
||||
// styled, and — the reason it did not work at all here — loses to a `<title>` inside the
|
||||
// SVG. The marks now carry no `<title>`, and the label lives on this element for both the
|
||||
// tooltip and the screen reader. `tabindex` so it is reachable without a mouse.
|
||||
<li
|
||||
class={runs(runtime) ? 'yes' : 'no'}
|
||||
data-tip={tooltip(runtime)}
|
||||
role="img"
|
||||
aria-label={tooltip(runtime)}
|
||||
tabindex="0"
|
||||
>
|
||||
<Fragment set:html={ICONS[runtime]} />
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
|
||||
<p>{description}</p>
|
||||
|
||||
<p class="links">
|
||||
{npm && <a href={`https://www.npmjs.com/package/${npm}`}>npm</a>}
|
||||
{jsr && <a href={`https://jsr.io/${jsr}`}>JSR</a>}
|
||||
<a href={repo}>source</a>
|
||||
</p>
|
||||
|
||||
{
|
||||
internal && (
|
||||
<p class="why">
|
||||
<a href={`${repo}#runtimes`}>why not the others</a>
|
||||
</p>
|
||||
)
|
||||
}
|
||||
</article>
|
||||
@@ -0,0 +1,28 @@
|
||||
import { defineCollection, z } from 'astro:content';
|
||||
import { glob } from 'astro/loaders';
|
||||
|
||||
// Naming, from spec 5.2. Enforced here so a wrongly-named submission is rejected by the build
|
||||
// rather than by a reviewer's memory.
|
||||
// internal npm @green-tea/<x> JSR @green-tea/<x>
|
||||
// third party npm green-tea-<x> or @scope/green-tea-<x>
|
||||
const NPM_NAME = /^(@green-tea\/[a-z0-9-]+|green-tea-[a-z0-9-]+|@[a-z0-9-]+\/green-tea-[a-z0-9-]+)$/;
|
||||
const JSR_NAME = /^@[a-z0-9-]+\/(green-tea-)?[a-z0-9-]+$/;
|
||||
|
||||
const plugins = defineCollection({
|
||||
loader: glob({ pattern: '**/[^_]*.yaml', base: './src/content/plugins' }),
|
||||
schema: z
|
||||
.object({
|
||||
// `npm` and `jsr` rather than one `name`: a third party's package has a different name on
|
||||
// each registry. No `version` and no `runtimes` — both come from the registry, so an entry
|
||||
// cannot go stale or claim a runtime the package never declared.
|
||||
npm: z.string().regex(NPM_NAME, 'npm name must be @green-tea/<x>, green-tea-<x> or @scope/green-tea-<x>').optional(),
|
||||
jsr: z.string().regex(JSR_NAME, 'JSR name must be @scope/<x>').optional(),
|
||||
repo: z.string().url(),
|
||||
description: z.string().min(20).max(200),
|
||||
})
|
||||
.refine((entry) => entry.npm ?? entry.jsr, {
|
||||
message: 'an entry needs at least one of npm / jsr — otherwise there is nothing to install',
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = { plugins };
|
||||
@@ -0,0 +1,4 @@
|
||||
npm: "@green-tea/jwt"
|
||||
jsr: "@green-tea/jwt"
|
||||
repo: https://github.com/Expressive-Tea/green-tea-plugins
|
||||
description: "Loads JWT signing keys at boot and publishes a sign/verify registry into the graph."
|
||||
@@ -0,0 +1,4 @@
|
||||
npm: "@green-tea/metrics"
|
||||
jsr: "@green-tea/metrics"
|
||||
repo: https://github.com/Expressive-Tea/green-tea-plugins
|
||||
description: "Counts green-tea's lifecycle events and renders them in the Prometheus text format."
|
||||
@@ -0,0 +1,4 @@
|
||||
npm: "@green-tea/rate-limit"
|
||||
jsr: "@green-tea/rate-limit"
|
||||
repo: https://github.com/Expressive-Tea/green-tea-plugins
|
||||
description: "A per-request rate limiter with a branded 429 and a swept in-memory store."
|
||||
@@ -0,0 +1 @@
|
||||
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m8.213.063 8.879 12.136-8.67 11.739h2.476l8.665-11.735-8.89-12.14Zm4.728 0 9.02 11.992-9.018 11.883h2.496L24 12.656v-1.199L15.434.063ZM7.178 2.02.01 11.398l-.01 1.2 7.203 9.644 1.238-1.676-6.396-8.556 6.361-8.313Z"/></svg>
|
||||
|
After Width: | Height: | Size: 328 B |
@@ -0,0 +1 @@
|
||||
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M1.105 18.02A11.9 11.9 0 0 1 0 12.985q0-.698.078-1.376a12 12 0 0 1 .231-1.34A12 12 0 0 1 4.025 4.02a12 12 0 0 1 5.46-2.771 12 12 0 0 1 3.428-.23c1.452.112 2.825.477 4.077 1.05a12 12 0 0 1 2.78 1.774 12.02 12.02 0 0 1 4.053 7.078A12 12 0 0 1 24 12.985q0 .454-.036.914a12 12 0 0 1-.728 3.305 12 12 0 0 1-2.38 3.875c-1.33 1.357-3.02 1.962-4.43 1.936a4.4 4.4 0 0 1-2.724-1.024c-.99-.853-1.391-1.83-1.53-2.919a5 5 0 0 1 .128-1.518c.105-.38.37-1.116.76-1.437-.455-.197-1.04-.624-1.226-.829-.045-.05-.04-.13 0-.183a.155.155 0 0 1 .177-.053c.392.134.869.267 1.372.35.66.111 1.484.25 2.317.292 2.03.1 4.153-.813 4.812-2.627s.403-3.609-1.96-4.685-3.454-2.356-5.363-3.128c-1.247-.505-2.636-.205-4.06.582-3.838 2.121-7.277 8.822-5.69 15.032a.191.191 0 0 1-.315.19 12 12 0 0 1-1.25-1.634 12 12 0 0 1-.769-1.404M11.57 6.087c.649-.051 1.214.501 1.31 1.236.13.979-.228 1.99-1.41 2.013-1.01.02-1.315-.997-1.248-1.614.066-.616.574-1.575 1.35-1.635"/></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,75 @@
|
||||
---
|
||||
import { getCollection } from 'astro:content';
|
||||
import { readEntry } from '../../scripts/registry.mjs';
|
||||
// Remove this import together with scripts/preview.mjs once the seed plugins are published.
|
||||
import { PREVIEW } from '../../scripts/preview.mjs';
|
||||
import PluginCard from '../components/PluginCard.astro';
|
||||
import '../styles/global.css';
|
||||
|
||||
// Read at build time, never at request time — this site is static files on cPanel. Under CI a
|
||||
// registry that does not answer fails the build; off CI an unpublished package falls back to
|
||||
// preview data so the page can still be looked at. See scripts/registry.mjs.
|
||||
const entries = await getCollection('plugins');
|
||||
const plugins = await Promise.all(
|
||||
entries.map(async (entry) => {
|
||||
const { version, runtimes } = await readEntry(entry.data, PREVIEW);
|
||||
|
||||
return {
|
||||
name: entry.data.npm ?? entry.data.jsr,
|
||||
description: entry.data.description,
|
||||
repo: entry.data.repo,
|
||||
npm: entry.data.npm,
|
||||
jsr: entry.data.jsr,
|
||||
version,
|
||||
runtimes,
|
||||
// An internal plugin could be listed on JSR alone and still be ours, so check both fields.
|
||||
internal: (entry.data.npm ?? entry.data.jsr ?? '').startsWith('@green-tea/'),
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
plugins.sort((a, b) => a.name.localeCompare(b.name));
|
||||
---
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>green-tea plugins</title>
|
||||
<meta name="description" content="Plugins for green-tea, with the runtimes each one declares." />
|
||||
<link rel="canonical" href="https://green-tea.expressive-tea.io/plugins" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<header>
|
||||
<h1>green-tea <em>plugins</em></h1>
|
||||
<p>
|
||||
A plugin is a named object that adds steps and providers to your graph. It imports green-tea
|
||||
as types only, so installing one never pulls a second copy of core.
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://github.com/Expressive-Tea/green-tea-marketplace/blob/main/CONTRIBUTING.md">
|
||||
Add your plugin →
|
||||
</a>
|
||||
</p>
|
||||
<p class="requires">
|
||||
Everything here needs <code>@green-tea/core@26.9.0-beta.2</code> or newer. That is the
|
||||
release where a plugin became <code>{ name, mount }</code> and <code>app.boot()</code>
|
||||
went public; on anything older these will not mount.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div class="grid">
|
||||
{plugins.map((plugin) => <PluginCard {...plugin} />)}
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>
|
||||
Part of <a href="https://expressive-tea.io">Expressive Tea</a> ·
|
||||
<a href="https://green-tea.expressive-tea.io">green-tea</a> ·
|
||||
<a href="https://github.com/Expressive-Tea/green-tea-marketplace">this listing on GitHub</a>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,327 @@
|
||||
/* Type and palette are green-tea-site's, self-hosted the same way, so the sites read as one
|
||||
project rather than as three that happen to share a colour. */
|
||||
@font-face {
|
||||
font-family: 'Zen Maru Gothic';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url('/plugins/fonts/zen-maru-gothic-latin-500.woff2') format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
|
||||
U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Zen Maru Gothic';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('/plugins/fonts/zen-maru-gothic-latin-700.woff2') format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
|
||||
U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
:root {
|
||||
--base: #0d1117;
|
||||
--panel: #161b22;
|
||||
--line: #21262d;
|
||||
--matcha: #5fb88a;
|
||||
--matcha-deep: #3fa873;
|
||||
--violet: #7c6cf0;
|
||||
--ink: #e6edf3;
|
||||
--dim: #8b949e;
|
||||
|
||||
--font-heading: 'Zen Maru Gothic', var(--font-body);
|
||||
--font-body:
|
||||
-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
||||
--font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
|
||||
|
||||
--max-width: 1120px;
|
||||
--gutter: 24px;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--base);
|
||||
color: var(--ink);
|
||||
font-family: var(--font-body);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: var(--font-heading);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
max-width: var(--max-width);
|
||||
margin: 0 auto;
|
||||
padding: 64px var(--gutter) 96px;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
font-size: clamp(2rem, 5vw, 3rem);
|
||||
margin: 0 0 12px;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
header h1 em {
|
||||
color: var(--matcha);
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
header p {
|
||||
color: var(--dim);
|
||||
max-width: 62ch;
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
|
||||
header a {
|
||||
color: var(--matcha);
|
||||
}
|
||||
|
||||
/* The one thing a reader has to know before installing anything here. */
|
||||
.requires {
|
||||
margin: 24px 0 0;
|
||||
padding: 12px 16px;
|
||||
border-left: 3px solid var(--violet);
|
||||
background: rgba(124, 108, 240, 0.07);
|
||||
color: var(--dim);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.requires code {
|
||||
font-family: var(--font-mono);
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.card {
|
||||
position: relative;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
padding: 22px 24px 18px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
margin: 0;
|
||||
/* Room for the version pinned to the corner, so a long name wraps instead of running under it. */
|
||||
padding-right: 104px;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 1.05rem;
|
||||
font-weight: 500;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.version {
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
right: 18px;
|
||||
padding: 3px 9px;
|
||||
border-radius: 999px;
|
||||
background: rgba(95, 184, 138, 0.12);
|
||||
border: 1px solid rgba(95, 184, 138, 0.3);
|
||||
color: var(--matcha);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.72rem;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Runs-on, directly under the title. Colour means it runs there; grey means it does not. */
|
||||
.runtimes {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.runtimes li {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--line);
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.runtimes svg {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
fill: currentColor;
|
||||
/* The hover target is always the <li>. Without this the pointer lands on the mark instead and
|
||||
the tooltip below never fires. */
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* A real tooltip, not the native one: instant, styled, and it cannot be hijacked by anything
|
||||
inside the icon. */
|
||||
.runtimes li::after {
|
||||
content: attr(data-tip);
|
||||
position: absolute;
|
||||
bottom: calc(100% + 9px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%) translateY(4px);
|
||||
z-index: 2;
|
||||
width: max-content;
|
||||
max-width: 220px;
|
||||
padding: 7px 10px;
|
||||
border-radius: 7px;
|
||||
border: 1px solid var(--line);
|
||||
background: #0b0f14;
|
||||
color: var(--ink);
|
||||
font-family: var(--font-body);
|
||||
font-size: 0.74rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
text-align: center;
|
||||
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition:
|
||||
opacity 120ms ease,
|
||||
transform 120ms ease;
|
||||
}
|
||||
|
||||
/* The arrow. A rotated square is one element fewer than a border triangle and inherits the
|
||||
tooltip's own border. */
|
||||
.runtimes li::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: calc(100% + 5px);
|
||||
left: 50%;
|
||||
z-index: 3;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background: #0b0f14;
|
||||
border-right: 1px solid var(--line);
|
||||
border-bottom: 1px solid var(--line);
|
||||
transform: translateX(-50%) rotate(45deg) translateY(4px);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition:
|
||||
opacity 120ms ease,
|
||||
transform 120ms ease;
|
||||
}
|
||||
|
||||
.runtimes li:hover::after,
|
||||
.runtimes li:focus-visible::after {
|
||||
opacity: 1;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.runtimes li:hover::before,
|
||||
.runtimes li:focus-visible::before {
|
||||
opacity: 1;
|
||||
transform: translateX(-50%) rotate(45deg) translateY(0);
|
||||
}
|
||||
|
||||
.runtimes li:focus-visible {
|
||||
outline: 2px solid var(--matcha);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* An unsupported mark is dimmed, but its tooltip has to stay readable — the opacity sits on the
|
||||
list item, so lift it back on the tooltip. */
|
||||
.runtimes .no::after,
|
||||
.runtimes .no::before {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.runtimes .no:hover,
|
||||
.runtimes .no:focus-visible {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.runtimes .no:hover svg,
|
||||
.runtimes .no:focus-visible svg {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
.runtimes .yes {
|
||||
color: var(--matcha);
|
||||
border-color: rgba(95, 184, 138, 0.35);
|
||||
background: rgba(95, 184, 138, 0.09);
|
||||
}
|
||||
|
||||
/* Dim grey, and only 45% opaque: unsupported should read as absent at a glance, not as a second
|
||||
kind of support. */
|
||||
.runtimes .no {
|
||||
color: #6e7681;
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
.card > p {
|
||||
margin: 0;
|
||||
color: var(--dim);
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.links {
|
||||
margin: 4px 0 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.links a {
|
||||
color: var(--matcha);
|
||||
text-decoration: none;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 6px;
|
||||
padding: 4px 11px;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.links a:hover {
|
||||
border-color: var(--matcha-deep);
|
||||
}
|
||||
|
||||
.why {
|
||||
margin: 4px 0 0;
|
||||
text-align: center;
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
.why a {
|
||||
color: var(--dim);
|
||||
text-decoration: none;
|
||||
border-bottom: 1px dotted var(--line);
|
||||
}
|
||||
|
||||
.why a:hover {
|
||||
color: var(--matcha);
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-top: 64px;
|
||||
padding-top: 24px;
|
||||
border-top: 1px solid var(--line);
|
||||
color: var(--dim);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
footer a {
|
||||
color: var(--matcha);
|
||||
}
|
||||
Reference in new issue
Block a user