Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Shpetim <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
23 lines
894 B
TypeScript
23 lines
894 B
TypeScript
import type { CSSProperties } from "react";
|
|
|
|
/** Shadow-root overrides that make a Pierre file tree read as part of the app chrome. */
|
|
export const PIERRE_TREE_UNSAFE_CSS = `
|
|
:host {
|
|
--trees-bg-override: transparent;
|
|
--trees-selected-bg-override: color-mix(in srgb, currentColor 12%, transparent);
|
|
--trees-hover-bg-override: color-mix(in srgb, currentColor 7%, transparent);
|
|
--trees-border-color-override: color-mix(in srgb, currentColor 14%, transparent);
|
|
--trees-font-family-override: var(--font-sans);
|
|
--trees-font-size-override: 12px;
|
|
}
|
|
button[data-type='item'] { border-radius: 5px; }
|
|
`;
|
|
|
|
/** Host styles that keep a Pierre tree on the active color scheme and foreground. */
|
|
export function pierreTreeStyle(colorScheme: "light" | "dark"): CSSProperties {
|
|
return {
|
|
colorScheme,
|
|
["--trees-fg-override" as string]: "var(--contrast-foreground)",
|
|
};
|
|
}
|