index changes
This commit is contained in:
37
find_mismatches.js
Normal file
37
find_mismatches.js
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const cssDir = 'c:/xampp/htdocs/doormileweb/assets/css';
|
||||
const file = 'theme.css';
|
||||
const filePath = path.join(cssDir, file);
|
||||
const content = fs.readFileSync(filePath, 'utf8');
|
||||
|
||||
// Match rules
|
||||
// This is a bit complex as we need to find the rule block.
|
||||
// We'll simplify: look for blocks with font-family and content.
|
||||
|
||||
const rules = content.split('}');
|
||||
rules.forEach(rule => {
|
||||
if (rule.includes('content:') && rule.includes('font-family:')) {
|
||||
const contentMatch = rule.match(/content:\s*['"]\\([ef][a-f0-9]+)['"]/i);
|
||||
const fontMatch = rule.match(/font-family:\s*['"]?([^'";]+)['"]?/i);
|
||||
|
||||
if (contentMatch && fontMatch) {
|
||||
const hex = contentMatch[1].toLowerCase();
|
||||
const family = fontMatch[1];
|
||||
|
||||
// e... is usually fontello
|
||||
if (hex.startsWith('e') && (family.includes('Font Awesome') || family.includes('fa-'))) {
|
||||
console.log(`MISMATCH: ${hex} with ${family}`);
|
||||
console.log(rule.trim());
|
||||
}
|
||||
|
||||
// f... is usually font awesome
|
||||
if (hex.startsWith('f') && family.includes('fontello')) {
|
||||
console.log(`MISMATCH: ${hex} with ${family}`);
|
||||
console.log(rule.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user