mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-22 10:05:37 -04:00
e98c96b5a4
* This theme brings some changes to make the interface more readable to new users (outlined buttons) and a more modern approach (vibrant color, rounded buttons). It's still based on Material Design and similar to other themes, but is a first step toward an improved interface.
55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
const fs = require('fs');
|
|
const style = require('style-dictionary');
|
|
const readThemeRegistry = require('./lib/ReadThemeRegistry');
|
|
|
|
style.registerAction({
|
|
name: 'set_theme_class',
|
|
do(styleDictionary, config) {
|
|
let path = config.files[0].destination;
|
|
fs.writeFileSync(
|
|
path,
|
|
fs
|
|
.readFileSync(path)
|
|
.toString()
|
|
.replace(':root', '.' + config.theme)
|
|
);
|
|
},
|
|
undo() {},
|
|
});
|
|
|
|
const registry = readThemeRegistry();
|
|
|
|
for (let registration of registry) {
|
|
const theme = registration.id;
|
|
style
|
|
.extend({
|
|
source: [
|
|
`${__dirname}/../src/UI/Theme/Global/styles.json`, // Global styles
|
|
`${__dirname}/../src/UI/Theme/${theme}/theme.json`, // Theme specific overrides
|
|
],
|
|
platforms: {
|
|
css: {
|
|
theme,
|
|
transformGroup: 'css',
|
|
files: [
|
|
{
|
|
format: 'css/variables',
|
|
destination: `${__dirname}/../src/UI/Theme/${theme}/${theme}Variables.css`,
|
|
},
|
|
],
|
|
actions: ['set_theme_class'],
|
|
},
|
|
js: {
|
|
transformGroup: 'js',
|
|
files: [
|
|
{
|
|
format: 'json/flat',
|
|
destination: `${__dirname}/../src/UI/Theme/${theme}/${theme}Variables.json`,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
})
|
|
.buildAllPlatforms();
|
|
}
|