feat(header): icon nav redesign + migrate icons mdi→lucide
- Header desktop nav: social icons grouped in a wald-tinted pill with labels, active-state (aria-current + bold), opacity hover (no per-item bg) - Mobile overlay: social links as icon+label rows with active-state - Search button: lucide:search, icon-only - Migrate all icons mdi→lucide app-wide (234 refs); brand/language logos (google, whatsapp, mastodon, telegram, language-*) stay on mdi - generate-icons: emit mdi + lucide subsets; add @iconify-json/lucide - iconify-offline: register lucide collection - scripts/icon-map|validate|apply: reusable migration tooling Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { MAP, KEEP_MDI } from './icon-map.mjs';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const lucide = JSON.parse(
|
||||
fs.readFileSync(path.join(ROOT, 'node_modules/@iconify-json/lucide/icons.json'), 'utf8'),
|
||||
);
|
||||
const has = (n) => Boolean(lucide.icons[n] || (lucide.aliases && lucide.aliases[n]));
|
||||
|
||||
const all = fs
|
||||
.readFileSync(process.env.TMPDIR + '/mdi_all.txt', 'utf8')
|
||||
.trim()
|
||||
.split('\n')
|
||||
.map((s) => s.replace('mdi:', ''));
|
||||
const cms = ['cloud', 'email', 'facebook', 'map', 'video', 'whatsapp', 'youtube'];
|
||||
const set = [...new Set([...all, ...cms])].sort();
|
||||
|
||||
const bad = [];
|
||||
const unmapped = [];
|
||||
for (const m of set) {
|
||||
if (KEEP_MDI.has(m)) continue;
|
||||
const l = MAP[m];
|
||||
if (l === undefined) {
|
||||
unmapped.push(m);
|
||||
continue;
|
||||
}
|
||||
if (has(l) === false) bad.push(`${m} -> lucide:${l}`);
|
||||
}
|
||||
console.log('total mdi:', set.length, '| keep-mdi:', [...KEEP_MDI].filter((k) => set.includes(k)).length);
|
||||
console.log('UNMAPPED:', unmapped.length ? unmapped.join(', ') : 'none');
|
||||
console.log('INVALID lucide names:', bad.length ? '\n ' + bad.join('\n ') : 'none');
|
||||
Reference in New Issue
Block a user