Refactored css classes to match flyonui. Switched to postgres arrays for permissions. Migrated file manager. Adjusted everything to work with the latest mooncore version
This commit is contained in:
30
Moonlight.Client.Runtime/Styles/extract-classes.js
Normal file
30
Moonlight.Client.Runtime/Styles/extract-classes.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// extract-classes.js
|
||||
const fs = require('fs');
|
||||
|
||||
module.exports = (opts = {}) => {
|
||||
const classSet = new Set();
|
||||
|
||||
return {
|
||||
postcssPlugin: 'extract-tailwind-classes',
|
||||
Rule(rule) {
|
||||
const selectorParser = require('postcss-selector-parser');
|
||||
selectorParser(selectors => {
|
||||
selectors.walkClasses(node => {
|
||||
classSet.add(node.value);
|
||||
});
|
||||
}).processSync(rule.selector);
|
||||
},
|
||||
OnceExit() {
|
||||
const classArray = Array.from(classSet).sort();
|
||||
|
||||
if (!fs.existsSync("./mappings")){
|
||||
fs.mkdirSync("./mappings");
|
||||
}
|
||||
|
||||
fs.writeFileSync('./mappings/mooncore.map', classArray.join('\n'));
|
||||
console.log(`✅ Extracted ${classArray.length} Tailwind classes to tailwind-classes.txt`);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
module.exports.postcss = true;
|
||||
Reference in New Issue
Block a user