commandPalette.ts

 1import { ColorScheme } from "../themes/common/colorScheme"
 2import { withOpacity } from "../utils/color"
 3import { text, background } from "./components"
 4
 5export default function commandPalette(colorScheme: ColorScheme) {
 6    let layer = colorScheme.highest
 7    return {
 8        keystrokeSpacing: 8,
 9        key: {
10            text: text(layer, "mono", "variant", "default", { size: "xs" }),
11            cornerRadius: 2,
12            background: background(layer, "on"),
13            padding: {
14                top: 1,
15                bottom: 1,
16                left: 6,
17                right: 6,
18            },
19            margin: {
20                top: 1,
21                bottom: 1,
22                left: 2,
23            },
24            active: {
25                text: text(layer, "mono", "on", "default", { size: "xs" }),
26                background: withOpacity(background(layer, "on"), 0.2),
27            },
28        },
29    }
30}