- app.css: HEL-649 §一 tokens (bg/line/accent/status/text/type/space/radius/shadow/motion), legacy names aliased, reduced-motion via prefers-reduced-motion and data-reduce - shared .a-btn/.status-chip/.a-panel/inputs reskinned; new .a-tag/.a-progress/.a-sprocket/.a-stage/.a-float - tailwind colors/radii reference the same CSS variables - ui primitives (StatusChip/ProgressBar/Modal/Button/ConfirmDialog/Skeleton/Switch/Card/Toast) on tokens - running state -> --run, awaiting confirm -> --warn, --cloud purple removed, old palette literals -> tokens Co-authored-by: multica-agent <github@multica.ai>
45 lines
872 B
Svelte
45 lines
872 B
Svelte
<script lang="ts">
|
|
interface Props {
|
|
width?: string;
|
|
height?: string;
|
|
circle?: boolean;
|
|
}
|
|
|
|
let { width = '100%', height = '14px', circle = false }: Props = $props();
|
|
|
|
const resolvedWidth = $derived(circle && width === '100%' ? height : width);
|
|
</script>
|
|
|
|
<div
|
|
class="skeleton"
|
|
class:circle
|
|
style:width={resolvedWidth}
|
|
style:height
|
|
aria-hidden="true"
|
|
></div>
|
|
|
|
<style>
|
|
/* §四.9 骨架屏:--bg-3 圆角块,1.4s 呼吸透明度;减少动态时静态。 */
|
|
.skeleton {
|
|
background: var(--bg-3);
|
|
border-radius: var(--r-sm);
|
|
animation: skeleton-breath 1.4s ease-in-out infinite;
|
|
}
|
|
.skeleton.circle {
|
|
border-radius: 50%;
|
|
}
|
|
@keyframes skeleton-breath {
|
|
50% {
|
|
opacity: 0.5;
|
|
}
|
|
}
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.skeleton {
|
|
animation: none;
|
|
}
|
|
}
|
|
:global(:root[data-reduce='1']) .skeleton {
|
|
animation: none;
|
|
}
|
|
</style>
|