mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
- Get `make` to generate new `theme-vars.css` file when necessary Signed-off-by: Sebastian Malton <sebastian@malton.name>
28 lines
764 B
TypeScript
28 lines
764 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
|
|
import fs from "fs-extra";
|
|
import path from "path";
|
|
import defaultBaseLensTheme from "../src/renderer/themes/lens-dark";
|
|
|
|
const outputCssFile = path.resolve("src/renderer/themes/theme-vars.css");
|
|
|
|
const content = [
|
|
"/**",
|
|
" * Generated Lens theme CSS-variables, don't edit manually.",
|
|
" */",
|
|
"",
|
|
":root {",
|
|
...Object.entries(defaultBaseLensTheme.colors)
|
|
.map(([varName, value]) => ` --${varName}: ${value};`),
|
|
"}",
|
|
"",
|
|
].join("\n");
|
|
|
|
// Run
|
|
console.log("Writing out new generated src/renderer/themes/theme-vars.css file");
|
|
fs.ensureFileSync(outputCssFile);
|
|
fs.writeFile(outputCssFile, content);
|