~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0
110 lines · 4.7 KB Raw History
/* The values the components draw with. Colours, type, radii and shadows are
   the MCP Apps standard host variables (the spec's "Theming"): a host that
   passes them sets them on the root element, which wins over these, and these
   are what the view falls back to for any it leaves out. Each colour is
   `light-dark()`, so it follows the root's `color-scheme`, which the host's
   theme sets. Spaces are HUD's own, as the standard names none.
   Every text colour reads at 4.5:1 or better on the backgrounds it is drawn
   on, in light and in dark. */

:root {
	color-scheme: light dark;

	--color-background-primary: light-dark(#ffffff, #1b1b1a);
	--color-background-secondary: light-dark(#f4f4f2, #262624);
	--color-background-tertiary: light-dark(#e9e9e5, #31312f);
	--color-background-inverse: light-dark(#1b1b1a, #f4f4f2);
	--color-background-info: light-dark(#e8f0fb, #1b2a3d);
	--color-background-danger: light-dark(#fcebea, #3b1f1d);
	--color-background-warning: light-dark(#fdf3e1, #392e18);

	--color-text-primary: light-dark(#1b1b1a, #f2f2ef);
	--color-text-secondary: light-dark(#4e4e49, #c2c2bc);
	--color-text-tertiary: light-dark(#63635d, #a3a39d);
	--color-text-inverse: light-dark(#ffffff, #1b1b1a);
	--color-text-info: light-dark(#1c5aa6, #8fb8f0);
	--color-text-danger: light-dark(#aa2318, #f39a90);
	--color-text-warning: light-dark(#7d5200, #ecc274);
	/* A filled button's (Follow, Post, Send): the inverse by default; an
	   app's look gives its own primary. */
	--color-background-action: var(--color-background-inverse);
	--color-text-on-action: var(--color-text-inverse);

	--color-border-primary: light-dark(#cfcfca, #4a4a45);
	--color-border-secondary: light-dark(#e2e2de, #3a3a37);
	--color-border-danger: light-dark(#e7b4af, #6e3832);
	--color-border-warning: light-dark(#e6cf9d, #6a5426);

	--color-ring-primary: light-dark(#1c5aa6, #8fb8f0);

	/* What a pull, an issue or a check is in, by role (State), as knotless's
	   pages colour them: text on the backgrounds above, and a pill's fill
	   under --hud-color-on-role. */
	--hud-color-open: light-dark(#1a7f37, #3fb950);
	--hud-color-merged: light-dark(#7048b5, #b39af0);
	--hud-color-closed: light-dark(#cf222e, #f85149);
	--hud-color-neutral: light-dark(#636363, #9198a1);
	--hud-color-running: light-dark(#875b00, #d29922);
	--hud-color-on-role: light-dark(#ffffff, #1b1b1a);

	/* An Icon's tints, a menu row's mark, each under a white glyph
	   (--hud-tint-glyph) at 4.5:1 or more, the same in light and dark. */
	--hud-tint-green: #1a7f37;
	--hud-tint-blue: #1c5aa6;
	--hud-tint-purple: #7048b5;
	--hud-tint-gray: #636363;
	--hud-tint-yellow: #8a5d00;
	--hud-tint-red: #c4212c;
	--hud-tint-orange: #b34700;
	--hud-tint-glyph: #ffffff;

	/* A diff's lines added and removed, their numbers' gutters, and a
	   hunk's header, under the primary text. */
	--hud-diff-added: light-dark(#e6ffec, rgb(46 160 67 / 0.15));
	--hud-diff-added-number: light-dark(#ccffd8, rgb(63 185 80 / 0.3));
	--hud-diff-removed: light-dark(#ffebe9, rgb(248 81 73 / 0.1));
	--hud-diff-removed-number: light-dark(#ffd7d5, rgb(248 81 73 / 0.3));
	--hud-diff-hunk: light-dark(#ddf4ff, rgb(56 139 253 / 0.1));

	--font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
	--font-weight-normal: 400;
	--font-weight-medium: 500;
	--font-weight-semibold: 600;
	--font-weight-bold: 700;
	--font-text-xs-size: 0.75rem;
	--font-text-sm-size: 0.875rem;
	--font-text-md-size: 1rem;
	--font-text-xs-line-height: 1.4;
	--font-text-sm-line-height: 1.45;
	--font-text-md-line-height: 1.5;
	--font-heading-sm-size: 1rem;
	--font-heading-md-size: 1.125rem;
	--font-heading-lg-size: 1.375rem;
	--font-heading-sm-line-height: 1.35;
	--font-heading-md-line-height: 1.3;
	--font-heading-lg-line-height: 1.25;

	--border-radius-xs: 4px;
	--border-radius-sm: 6px;
	--border-radius-md: 8px;
	--border-radius-lg: 12px;
	--border-radius-full: 9999px;
	--border-width-regular: 1px;

	--shadow-sm: 0 1px 2px light-dark(rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.4));
	/* What floats over everything (a composer): its shadow, and the page dimmed behind it. */
	--shadow-lg: 0 8px 24px light-dark(rgb(0 0 0 / 0.12), rgb(0 0 0 / 0.5)), 0 1px 2px light-dark(rgb(0 0 0 / 0.06), rgb(0 0 0 / 0.3));
	--hud-scrim: light-dark(rgb(0 0 0 / 0.4), rgb(0 0 0 / 0.6));
	/* A box a person types in on a phone: 16px or more, or iOS zooms in on it. */
	--hud-text-field: 1rem;
	/* The host's reading width: what a Stack with measure content is held to in a view drawn wider. A host sets its own. */
	--hud-reading-width: 37.5rem;

	--hud-space-1: 0.25rem;
	--hud-space-2: 0.5rem;
	--hud-space-3: 0.75rem;
	--hud-space-4: 1rem;
	--hud-space-5: 1.5rem;
	--hud-space-6: 2rem;
}