-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch-css.js
More file actions
36 lines (31 loc) · 838 Bytes
/
Copy pathpatch-css.js
File metadata and controls
36 lines (31 loc) · 838 Bytes
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
const fs = require('fs');
let css = fs.readFileSync('public/Assets/styles.css', 'utf8');
// 1. Add mobile sidebar styles
const mobileStyles = `
/* Mobile Sidebars */
@media (max-width: 900px) {
.sidebar {
display: none;
position: fixed;
top: 5rem;
left: 0;
width: 250px;
height: calc(100vh - 5rem);
z-index: 100;
border-radius: 0 12px 12px 0;
}
.sidebar-right {
left: auto;
right: 0;
border-radius: 12px 0 0 12px;
}
.three-column-layout {
gap: 0;
}
}
`;
css += mobileStyles;
// 2. Clean up old mobile styles
css = css.replace(/@media \(max-width: 585px\) \{[\s\S]*?@media \(max-width: 375px\) \{[\s\S]*?\}/, '');
fs.writeFileSync('public/Assets/styles.css', css, 'utf8');
console.log('CSS Refactoring complete');