Open History to see the last commit
1import type { CSSProperties } from "react";
2
3/** Shadow-root overrides that make a Pierre file tree read as part of the app chrome. */
4export const PIERRE_TREE_UNSAFE_CSS = `
5 :host {
6 --trees-bg-override: transparent;
7 --trees-selected-bg-override: color-mix(in srgb, currentColor 12%, transparent);
8 --trees-hover-bg-override: color-mix(in srgb, currentColor 7%, transparent);
9 --trees-border-color-override: color-mix(in srgb, currentColor 14%, transparent);
10 --trees-font-family-override: var(--font-sans);
11 --trees-font-size-override: 12px;
12 }
13 button[data-type='item'] { border-radius: 5px; }
14`;
15
16/** Host styles that keep a Pierre tree on the active color scheme and foreground. */
17export function pierreTreeStyle(colorScheme: "light" | "dark"): CSSProperties {
18 return {
19 colorScheme,
20 ["--trees-fg-override" as string]: "var(--contrast-foreground)",
21 };
22}