-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate-css.js
51 lines (46 loc) · 2.06 KB
/
generate-css.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
// generate-css.js
const fs = require("fs");
const path = require("path");
require("dotenv").config(); // Load environment variables from .env file
const colors = {
primary: process.env.COLOR_PRIMARY || "F3F4F8",
secondary: process.env.COLOR_SECONDARY || "000",
mainBg: process.env.COLOR_MAIN_BACKGROUND || "FFFFFF",
gradOne: process.env.COLOR_GRADONE || "4472ad",
gradTwo: process.env.COLOR_GRADTWO || "009dea",
cardOne: process.env.COLOR_CARDONE || "E8EAF0",
cardTwo: process.env.COLOR_CARDTWO || "049BE8",
linkColor: process.env.COLOR_LINKCOLOR || "4f58a3",
icon: process.env.COLOR_ICON || "4B9CE3",
camera: process.env.COLOR_CAMERA || "FFFFFF",
modalText: process.env.COLOR_MODAL_TEXT || "000000",
leaderboardText: process.env.COLOR_LEADERBOARD_TEXT || "000000",
headerText: process.env.COLOR_HEADER_TEXT || "000000",
mainText: process.env.COLOR_MAIN_TEXT || "000000",
freeUseText: process.env.COLOR_FREE_USE_TEXT || "0A7D6C",
primaryBtnText: process.env.COLOR_PRIMARY_BTN_TEXT || 'FFFFFF',
secondaryBtnText: process.env.COLOR_SECONDARY_BTN_TEXT || '000000'
};
const css = `:root {
--primary: #${colors.primary};
--secondary: #${colors.secondary};
--mainBg: #${colors.mainBg};
--gradOne: #${colors.gradOne};
--gradTwo: #${colors.gradTwo};
--cardOne: #${colors.cardOne};
--cardTwo: #${colors.cardTwo};
--linkColor: #${colors.linkColor};
--icon: #${colors.icon};
--camera: #${colors.camera};
--modalText: #${colors.modalText};
--leaderboardText: #${colors.leaderboardText};
--headerText: #${colors.headerText};
--mainText: #${colors.mainText};
--freeUseText: #${colors.freeUseText};
--bgFreeUse: #${colors.freeUseText}1A;
--primaryBtnText: #${colors.primaryBtnText};
--secondaryBtnText: #${colors.secondaryBtnText};
}`;
const outputPath = path.resolve(__dirname, "src/style/global.css");
fs.writeFileSync(outputPath, css);
console.log(`CSS file generated at: ${outputPath}`);