-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgenerate-themes.js
84 lines (70 loc) · 1.56 KB
/
generate-themes.js
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* generate json with themes
*/
var themes = [];
var colors = [
'black',
'white',
'blue',
'dark-blue',
'turquoise',
'red',
'orange',
'green',
'dark-green',
'pink',
'purple'
];
var themesWithColors = [
'theme-topline',
'theme-simple',
'theme-corners',
'theme-half',
'theme-border',
'theme-line',
'theme-third'
];
themesWithColors.forEach(function(theme) {
colors.forEach(function(color) {
if(
(theme === 'theme-half' ||
theme === 'theme-border' ||
theme === 'theme-third' ||
theme === 'theme-line'||
theme === 'theme-topline') &&
color === 'white'
) {
} else {
themes.push({
name: theme + '--' + color
});
}
});
});
[].push.apply(themes, [
{
name: 'theme-diagonals'
}
]);
// add the picture themes at the top
[].unshift.apply(themes, [
{ name: 'theme-picture--space-full' },
{ name: 'theme-picture--food-full' },
{ name: 'theme-picture--school-full' },
{ name: 'theme-picture--restaurant-full' },
{ name: 'theme-picture--stardust-full' },
{ name: 'theme-picture--space-half' },
{ name: 'theme-picture--space-half-black' },
{ name: 'theme-picture--space-top' },
{ name: 'theme-picture--space-top-black' },
{ name: 'theme-picture--city-half' },
{ name: 'theme-picture--city-half-black' },
{ name: 'theme-picture--city-top' },
{ name: 'theme-picture--city-top-black' }
]);
// write json file
var fs = require('fs');
fs.writeFile('./themes.json', JSON.stringify({ list: themes }), function(err) {
if(err) {
return console.log(err);
}
});