MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / buildCSS

Function buildCSS

build-css.mjs:82–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80const REMAINING_STYLES = ``;
81
82function buildCSS() {
83 console.log('Building CSS...');
84
85 let combinedCSS = MAIN_CSS_TEMPLATE;
86
87 // Read and concatenate each CSS file
88 for (const cssFile of CSS_FILES) {
89 try {
90 const content = readFileSync(cssFile, 'utf8');
91
92 // Add a section header comment
93 const filename = cssFile.split('/').pop();
94 combinedCSS += `\n/* ===== ${filename.toUpperCase()} ===== */\n`;
95 combinedCSS += content;
96 combinedCSS += '\n';
97
98 console.log(`[OK] Included ${cssFile}`);
99 } catch (error) {
100 console.error(`[ERROR] Error reading ${cssFile}:`, error.message);
101 process.exit(1);
102 }
103 }
104
105 // Add the remaining modal styles
106 combinedCSS += REMAINING_STYLES;
107
108 // Write the combined CSS to styles.css
109 try {
110 writeFileSync('styles.css', combinedCSS);
111 console.log('[OK] Built styles.css successfully');
112
113 // Count lines for reference
114 const lineCount = combinedCSS.split('\n').length;
115 console.log(`[OK] Generated ${lineCount} lines of CSS`);
116
117 } catch (error) {
118 console.error('[ERROR] Error writing styles.css:', error.message);
119 process.exit(1);
120 }
121}
122
123// Run the build
124buildCSS();

Callers 1

build-css.mjsFile · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected