feat(ui): фаза 1 — шкалы motion/z-index в токенах, boot-скрипт темы в index.html, рецепты компонентов (design-system/recipes.ts) для button/input/badge/card/table, layout.taskDetail в скине, удалён мёртвый CSS (.btn-compact и др.) и зависимость tw-animate-css
This commit is contained in:
@@ -24,6 +24,45 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script>
|
||||
// Boot-скрипт: применяет тему/скин до загрузки React, чтобы не было вспышки
|
||||
// дефолтного скина, и восстанавливает rem-размер шрифта в PWA до первого рендера.
|
||||
// Зеркалит client/src/themes/ThemeProvider.tsx (ключи THEME_STORAGE_KEY='theme',
|
||||
// SKIN_STORAGE_KEY='skin') и client/src/hooks/usePwaFontSize.ts
|
||||
// (префикс 'pwa-font-size-', clamp 12..24) — при изменении там править и здесь.
|
||||
(function () {
|
||||
try {
|
||||
var root = document.documentElement;
|
||||
var theme = localStorage.getItem('theme');
|
||||
if (theme !== 'light' && theme !== 'dark') {
|
||||
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
}
|
||||
var skin = localStorage.getItem('skin') || 'iistwin';
|
||||
root.setAttribute('data-theme', theme);
|
||||
root.setAttribute('data-skin', skin);
|
||||
root.classList.remove('light', 'dark');
|
||||
root.classList.add(theme);
|
||||
|
||||
var isPwa =
|
||||
window.matchMedia('(display-mode: standalone)').matches ||
|
||||
window.navigator.standalone === true;
|
||||
if (isPwa) {
|
||||
for (var i = 0; i < localStorage.length; i++) {
|
||||
var key = localStorage.key(i);
|
||||
if (key && key.indexOf('pwa-font-size-') === 0) {
|
||||
var n = parseInt(localStorage.getItem(key), 10);
|
||||
if (!isNaN(n)) {
|
||||
root.style.fontSize = Math.max(12, Math.min(24, n)) + 'px';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
/* ignore: не блокируем загрузку приложения */
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user