mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: light mode skeleton style
This commit is contained in:
1 parent
7b650bf39b
commit
9bcaff9fd3
5 files changed
+48
-28
No files matched your search
@@ -1,17 +0,0 @@
|
||||
@keyframes skeleton-animation {
|
||||
0% {
|
||||
background-color: var(--black-a6);
|
||||
}
|
||||
50% {
|
||||
background-color: var(--black-a5);
|
||||
}
|
||||
100% {
|
||||
background-color: var(--black-a6);
|
||||
}
|
||||
}
|
||||
|
||||
.skeleton {
|
||||
animation: skeleton-animation var(--duration-subtle) ease infinite;
|
||||
|
||||
border-radius: var(--space-2);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
@keyframes skeleton-animation {
|
||||
0% {
|
||||
background-color: var(--color-1);
|
||||
}
|
||||
50% {
|
||||
background-color: var(--color-2);
|
||||
}
|
||||
100% {
|
||||
background-color: var(--color-1);
|
||||
}
|
||||
}
|
||||
|
||||
.skeleton {
|
||||
--color-1: var(--black-a5);
|
||||
--color-2: var(--black-a4);
|
||||
|
||||
:global(:root.dark) & {
|
||||
--color-1: var(--white-a3);
|
||||
--color-2: var(--white-a2);
|
||||
}
|
||||
|
||||
animation: skeleton-animation var(--duration-subtle) ease infinite;
|
||||
|
||||
border-radius: var(--space-2);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { ComponentProps } from "react";
|
||||
import { classNames } from "../../core/ui/classNames";
|
||||
import "./index.css";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
export interface SkeletonProps extends ComponentProps<"div"> {}
|
||||
|
||||
export function Skeleton({ className, ...props }: SkeletonProps) {
|
||||
return <div className={classNames("skeleton", className)} {...props} />;
|
||||
return <div className={classNames(styles.skeleton, className)} {...props} />;
|
||||
}
|
||||
@@ -35,13 +35,23 @@
|
||||
}
|
||||
|
||||
.name {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
.skeleton {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
|
||||
.text {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&[data-skeleton="true"] {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.skeleton {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,10 +50,12 @@ export function TankCard(props: PropsWithSkeleton<TankCardProps>) {
|
||||
{props.skeleton && <Skeleton className={styles.icon} />}
|
||||
</div>
|
||||
|
||||
<Text className={styles.name}>
|
||||
{props.skeleton && <InlineSkeleton className={styles.skeleton} />}
|
||||
{!props.skeleton && gameStrings![tank!.tank!.name!.value]}
|
||||
</Text>
|
||||
<div className={styles.name}>
|
||||
<Text className={styles.text} data-skeleton={props.skeleton}>
|
||||
{props.skeleton && <InlineSkeleton className={styles.skeleton} />}
|
||||
{!props.skeleton && gameStrings![tank!.tank!.name!.value]}
|
||||
</Text>
|
||||
</div>
|
||||
</LinkI18n>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user