Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c3a197a

Browse files
committedJun 6, 2022
feat: add themes management
1 parent 5b486b1 commit c3a197a

File tree

9 files changed

+681
-4
lines changed

9 files changed

+681
-4
lines changed
 
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: themes-weekly-pull
2+
3+
on:
4+
schedule:
5+
# run every monday at 2AM
6+
- cron: '0 2 * * 1'
7+
8+
jobs:
9+
pull-from-jsonbin:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Install Node.js 14.x
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: '14.x'
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: Install dependencies
22+
run: yarn
23+
24+
- name: Run themes:pull script
25+
run: yarn run themes:pull
26+
env:
27+
MASTER_KEY: ${{ secrets.MASTER_KEY }}
28+
BIN_ID: ${{ secrets.BIN_ID }}
29+
30+
- name: Generate dark tokens
31+
run: npx token-transformer scripts/themes/tokens/arduino-tokens.json scripts/themes/tokens/dark.json core,ide-default,ide-dark,theia core,ide-default,ide-dark
32+
33+
- name: Generate default tokens
34+
run: npx token-transformer scripts/themes/tokens/arduino-tokens.json scripts/themes/tokens/default.json core,ide-default,theia core,ide-default
35+
36+
- name: Run themes:generate script
37+
run: yarn run themes:generate
38+
39+
- name: Create Pull Request
40+
uses: peter-evans/create-pull-request@v3
41+
with:
42+
commit-message: Updated themes
43+
title: Update themes
44+
branch: themes/themes-update
45+
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

‎.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ yarn*.log
1717
plugins
1818
# the config files for the CLI
1919
arduino-ide-extension/data/cli/config
20+
# the tokens folder for the themes
21+
scripts/themes/tokens
22+
# environment variables
23+
.env

‎arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,14 @@ MonacoThemingService.register({
284284
id: 'arduino-theme',
285285
label: 'Light (Arduino)',
286286
uiTheme: 'vs',
287-
json: require('../../src/browser/data/arduino.color-theme.json'),
287+
json: require('../../src/browser/data/default.color-theme.json'),
288+
});
289+
290+
MonacoThemingService.register({
291+
id: 'arduino-theme-dark',
292+
label: 'Dark (Arduino)',
293+
uiTheme: 'vs-dark',
294+
json: require('../../src/browser/data/dark.color-theme.json'),
288295
});
289296

290297
export default new ContainerModule((bind, unbind, isBound, rebind) => {
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
{
2+
"name": "Arduino dark",
3+
"type": "dark",
4+
"colors": {
5+
"list.highlightForeground": "#171e21",
6+
"list.activeSelectionForeground": "#424242",
7+
"list.activeSelectionBackground": "#DAE3E3",
8+
"list.inactiveSelectionForeground": "#424242",
9+
"list.inactiveSelectionBackground": "#DAE3E3",
10+
"list.hoverBackground": "#ECF1F1",
11+
"progressBar.background": "#005c5f",
12+
"editor.background": "#1f272a",
13+
"editor.foreground": "#dae3e3",
14+
"editor.lineHighlightBackground": "#434f5410",
15+
"editor.selectionBackground": "#f1c40f",
16+
"editorCursor.foreground": "#434f54",
17+
"editorWhitespace.foreground": "#bfbfbf",
18+
"editorWidget.background": "#F7F9F9",
19+
"focusBorder": "#dae3e3",
20+
"menubar.selectionBackground": "#ffffff",
21+
"menubar.selectionForeground": "#212121",
22+
"menu.selectionBackground": "#dae3e3",
23+
"menu.selectionForeground": "#212121",
24+
"editorGroupHeader.tabsBackground": "#171e21",
25+
"button.background": "#0ca1a6",
26+
"titleBar.activeBackground": "#171e21",
27+
"titleBar.activeForeground": "#dae3e3",
28+
"terminal.background": "#000000",
29+
"terminal.foreground": "#e0e0e0",
30+
"dropdown.border": "#ececec",
31+
"dropdown.background": "#ececec",
32+
"activityBar.background": "#101618",
33+
"activityBar.foreground": "#dae3e3",
34+
"activityBar.inactiveForeground": "#4e5b61",
35+
"activityBar.activeBorder": "#0ca1a6",
36+
"statusBar.background": "#171e21",
37+
"secondaryButton.background": "#b5c8c9",
38+
"secondaryButton.foreground": "#ececec",
39+
"secondaryButton.hoverBackground": "#dae3e3",
40+
"arduino.branding.primary": "#0ca1a6",
41+
"arduino.branding.secondary": "#b5c8c9",
42+
"arduino.foreground": "#edf1f1",
43+
"arduino.output.foreground": "#ffffff",
44+
"arduino.output.background": "#000000",
45+
"sideBar.background": "#101618",
46+
"input.background": "#000000",
47+
"foreground": "#dae3e3",
48+
"settings.headerForeground": "#dae3e3",
49+
"tree.indentGuidesStroke": "#374146",
50+
"tab.unfocusedActiveForeground": "#dae3e3"
51+
},
52+
"tokenColors": [
53+
{
54+
"name": "",
55+
"settings": {
56+
"foreground": "#dae3e3"
57+
}
58+
},
59+
{
60+
"name": "Comments",
61+
"scope": "comment",
62+
"settings": {
63+
"foreground": "#7f8c8d"
64+
}
65+
},
66+
{
67+
"name": "Keywords Attributes",
68+
"scope": [
69+
"storage",
70+
"support",
71+
"string.quoted.single.c"
72+
],
73+
"settings": {
74+
"foreground": "#0ca1a6"
75+
}
76+
},
77+
{
78+
"name": "literal",
79+
"scope": [
80+
"meta.function.c",
81+
"entity.name.function",
82+
"meta.function-call.c",
83+
"variable.other"
84+
],
85+
"settings": {
86+
"foreground": "#F39C12"
87+
}
88+
},
89+
{
90+
"name": "punctuation",
91+
"scope": [
92+
"punctuation.section",
93+
"meta.function-call.c",
94+
"meta.block.c",
95+
"meta.function.c",
96+
"variable",
97+
"variable.name"
98+
],
99+
"settings": {
100+
"foreground": "#434f54"
101+
}
102+
},
103+
{
104+
"name": "function preprocessor",
105+
"scope": [
106+
"entity.name.function.preprocessor.c",
107+
"meta.preprocessor.macro.c"
108+
],
109+
"settings": {
110+
"foreground": "#569CD6"
111+
}
112+
},
113+
{
114+
"name": "constants",
115+
"scope": [
116+
"string.quoted.double",
117+
"string.quoted.other.lt-gt",
118+
"constant"
119+
],
120+
"settings": {
121+
"foreground": "#7fcbcd"
122+
}
123+
},
124+
{
125+
"name": "meta keywords",
126+
"scope": [
127+
"keyword.control",
128+
"meta.preprocessor.c"
129+
],
130+
"settings": {
131+
"foreground": "#C586C0"
132+
}
133+
},
134+
{
135+
"name": "numeric preprocessor",
136+
"scope": [
137+
"meta.preprocessor.macro.c",
138+
"constant.numeric.preprocessor.c",
139+
"meta.preprocessor.c"
140+
],
141+
"settings": {
142+
"foreground": "#434f54"
143+
}
144+
}
145+
]
146+
}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
{
2+
"name": "Arduino default",
3+
"type": "default",
4+
"colors": {
5+
"list.highlightForeground": "#006d70",
6+
"list.activeSelectionForeground": "#424242",
7+
"list.activeSelectionBackground": "#DAE3E3",
8+
"list.inactiveSelectionForeground": "#424242",
9+
"list.inactiveSelectionBackground": "#DAE3E3",
10+
"list.hoverBackground": "#ECF1F1",
11+
"progressBar.background": "#005c5f",
12+
"editor.background": "#ffffff",
13+
"editor.foreground": "#4e5b61",
14+
"editor.lineHighlightBackground": "#434f5410",
15+
"editor.selectionBackground": "#f1c40f",
16+
"editorCursor.foreground": "#434f54",
17+
"editorWhitespace.foreground": "#bfbfbf",
18+
"editorWidget.background": "#F7F9F9",
19+
"focusBorder": "#7fcbcd",
20+
"menubar.selectionBackground": "#ffffff",
21+
"menubar.selectionForeground": "#212121",
22+
"menu.selectionBackground": "#dae3e3",
23+
"menu.selectionForeground": "#212121",
24+
"editorGroupHeader.tabsBackground": "#ecf1f1",
25+
"button.background": "#7fcbcd",
26+
"titleBar.activeBackground": "#006d70",
27+
"titleBar.activeForeground": "#f7f9f9",
28+
"terminal.background": "#000000",
29+
"terminal.foreground": "#e0e0e0",
30+
"dropdown.border": "#ececec",
31+
"dropdown.background": "#ececec",
32+
"activityBar.background": "#ecf1f1",
33+
"activityBar.foreground": "#4e5b61",
34+
"activityBar.inactiveForeground": "#bdc7c7",
35+
"activityBar.activeBorder": "#008184",
36+
"statusBar.background": "#006d70",
37+
"secondaryButton.background": "#b5c8c9",
38+
"secondaryButton.foreground": "#ececec",
39+
"secondaryButton.hoverBackground": "#dae3e3",
40+
"arduino.branding.primary": "#008184",
41+
"arduino.branding.secondary": "#b5c8c9",
42+
"arduino.foreground": "#edf1f1",
43+
"arduino.output.foreground": "#ffffff",
44+
"arduino.output.background": "#000000",
45+
"sideBar.background": "#f7f9f9",
46+
"input.background": "#ffffff",
47+
"foreground": "#4e5b61",
48+
"settings.headerForeground": "#4e5b61",
49+
"tree.indentGuidesStroke": "#dae3e3",
50+
"tab.unfocusedActiveForeground": "#4e5b61"
51+
},
52+
"tokenColors": [
53+
{
54+
"name": "",
55+
"settings": {
56+
"foreground": "#434f54"
57+
}
58+
},
59+
{
60+
"name": "Comments",
61+
"scope": "comment",
62+
"settings": {
63+
"foreground": "#95a5a6cc"
64+
}
65+
},
66+
{
67+
"name": "Keywords Attributes",
68+
"scope": [
69+
"storage",
70+
"support",
71+
"string.quoted.single.c"
72+
],
73+
"settings": {
74+
"foreground": "#00979D"
75+
}
76+
},
77+
{
78+
"name": "literal",
79+
"scope": [
80+
"meta.function.c",
81+
"entity.name.function",
82+
"meta.function-call.c",
83+
"variable.other"
84+
],
85+
"settings": {
86+
"foreground": "#D35400"
87+
}
88+
},
89+
{
90+
"name": "punctuation",
91+
"scope": [
92+
"punctuation.section",
93+
"meta.function-call.c",
94+
"meta.block.c",
95+
"meta.function.c",
96+
"variable",
97+
"variable.name"
98+
],
99+
"settings": {
100+
"foreground": "#434f54"
101+
}
102+
},
103+
{
104+
"name": "function preprocessor",
105+
"scope": [
106+
"entity.name.function.preprocessor.c",
107+
"meta.preprocessor.macro.c"
108+
],
109+
"settings": {
110+
"foreground": "#9e846d"
111+
}
112+
},
113+
{
114+
"name": "constants",
115+
"scope": [
116+
"string.quoted.double",
117+
"string.quoted.other.lt-gt",
118+
"constant"
119+
],
120+
"settings": {
121+
"foreground": "#005C5F"
122+
}
123+
},
124+
{
125+
"name": "meta keywords",
126+
"scope": [
127+
"keyword.control",
128+
"meta.preprocessor.c"
129+
],
130+
"settings": {
131+
"foreground": "#728E00"
132+
}
133+
},
134+
{
135+
"name": "numeric preprocessor",
136+
"scope": [
137+
"meta.preprocessor.macro.c",
138+
"constant.numeric.preprocessor.c",
139+
"meta.preprocessor.c"
140+
],
141+
"settings": {
142+
"foreground": "#434f54"
143+
}
144+
}
145+
]
146+
}

‎package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
"rimraf": "^2.6.1",
3333
"semver": "^7.3.2",
3434
"typescript": "~4.5.5",
35-
"jsdom": "^11.5.1"
35+
"jsdom": "^11.5.1",
36+
"style-dictionary": "^3.7.0",
37+
"xhr2": "^0.2.1"
3638
},
3739
"resolutions": {
3840
"find-git-exec": "0.0.4",
@@ -53,6 +55,8 @@
5355
"i18n:check": "yarn i18n:generate && git add -N ./i18n && git diff --exit-code ./i18n",
5456
"i18n:push": "node ./scripts/i18n/transifex-push.js ./i18n/en.json",
5557
"i18n:pull": "node ./scripts/i18n/transifex-pull.js ./i18n/",
58+
"themes:pull": "node ./scripts/themes/theme-tokens-pull.js",
59+
"themes:generate": "node ./scripts/themes/theme-generator.js",
5660
"compose-changelog": "yarn --cwd ./arduino-ide-extension compose-changelog"
5761
},
5862
"lint-staged": {

0 commit comments

Comments
 (0)
Please sign in to comment.