fix(#9,#16,#17): 移除未使用import; 合并重复CSS @media print; accessibility从i18n读取类型名

This commit is contained in:
tianhao
2026-06-16 12:42:36 +08:00
parent 7bc2bf6ace
commit 56bac1fa0f
3 changed files with 8 additions and 10 deletions
+4 -2
View File
@@ -5,6 +5,8 @@
* @description 插件管理器 + 3 款预设插件 (keyboard / persistence / accessibility)
*/
import { t } from './i18n.js';
/**
* 插件管理器
*/
@@ -154,8 +156,8 @@ const presetPlugins = {
el.setAttribute('aria-live', 'assertive');
el.setAttribute('aria-atomic', 'true');
el.style.cssText = 'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;';
const typeNames = { success:'成功', error:'错误', warning:'警告', info:'信息', loading:'加载中', default:'通知' };
el.textContent = `${typeNames[toast.type] || '通知'}: ${toast.title || ''} ${toast.message || ''}`;
const typeName = t(toast.type) || toast.type;
el.textContent = `${typeName}: ${toast.title || ''} ${toast.message || ''}`;
document.body.appendChild(el);
setTimeout(() => { if (el.parentNode) el.parentNode.removeChild(el); }, 3000);
},