-
Notifications
You must be signed in to change notification settings - Fork 120
/
Copy pathkeypirinha.ts
58 lines (51 loc) · 2.12 KB
/
keypirinha.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import type { Template } from './index.js';
import { AnnotatedVariant, colorSetToVariants } from '../color-set/index.js';
import { source } from 'common-tags';
function themeName(variant: AnnotatedVariant): string {
return `${variant.title.upperCamel}Colors`;
}
const template: Template = {
name: 'Keypirinha',
render: async function* (colorSet) {
const variants = colorSetToVariants(colorSet);
for (const variant of variants) {
yield {
path: `keypirinha-${variant.title.kebab}.ini`,
content: source`
[theme/${themeName(variant)}]
color_background = ${variant.colors.shade0}
color_foreground = ${variant.colors.shade7}
color_faded = ${variant.colors.shade5}
color_accent = ${variant.colors.accent6}
color_warn = ${variant.colors.accent0}
color_title = ${variant.colors.shade7}
color_status = ${variant.colors.accent5}
color_textbox_back = ${variant.colors.shade0}
color_listitem_back = ${variant.colors.shade0}
color_listitem_title = ${variant.colors.shade7}
color_listitem_desc = ${variant.colors.accent5}
color_listitem_tips = ${variant.colors.accent5}
color_listitem_selected_back = ${variant.colors.shade1}
color_listitem_selected_title = ${variant.colors.accent7}
color_listitem_selected_desc = ${variant.colors.shade7}
color_listitem_selected_tips = ${variant.colors.accent7}
`,
};
}
},
renderInstructions: (paths, colorSet) => source`
1. Open the Keypirinha Configuration:
- Select **Keypirinha: Configure** item from the Keypirinha LaunchBox
- Right-Click **Keypirinha** -> **Configure Keypirinha**
2. Add the contents of ${paths
.map((p) => `\`${p}\``)
.join(' and ')} to the \`Keypirinha.ini\` file.
3. Set/Append the desired theme name (${colorSetToVariants(colorSet)
.map(themeName)
.map((name) => `"${name}"`)
.join(
' or ',
)}) to the \`theme\` property under the \`[gui]\` section of the \`Keypirinha.ini\` file.
`,
};
export default template;