Skip to content

Commit 33181f4

Browse files
committed
Fix Skeleton theme
1 parent 43cb82d commit 33181f4

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/elements/Avatar/Avatar.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { generateColor } from '@marko19907/string-to-color';
21
import getInitials from 'name-initials';
32
import type { FC, LegacyRef } from 'react';
43
import React, { forwardRef, useMemo } from 'react';
54

6-
import { twMerge } from '@/utils';
5+
import { generateColor, twMerge } from '@/utils';
76
import { useComponentTheme } from '@/utils';
87

98
import type { AvatarTheme } from './AvatarTheme';

src/elements/Skeleton/SkeletonTheme.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,14 @@ export interface SkeletonTheme {
1010
};
1111
}
1212

13-
const baseTheme: SkeletonTheme = {
14-
base: 'rounded-md',
15-
animated: '',
13+
export const skeletonTheme: SkeletonTheme = {
14+
base: 'rounded-md light:bg-gray-200 dark:bg-gray-700',
15+
animated:
16+
'animate-[pulse_1.5s_ease-in-out_infinite] light:bg-gradient-to-r light:from-gray-200 light:via-gray-300 light:to-gray-200 dark:bg-gradient-to-r dark:from-gray-700 dark:via-gray-600 dark:to-gray-700 bg-[length:200%_100%]',
1617
variants: {
1718
text: 'h-4 w-full',
1819
rounded: 'rounded-full w-10 h-10',
1920
rectangle: 'h-24 w-full',
2021
square: 'w-24 h-24'
2122
}
2223
};
23-
24-
export const skeletonTheme: SkeletonTheme = {
25-
...baseTheme,
26-
base: [baseTheme.base, 'light:bg-gray-200 dark:bg-gray-700'].join(' '),
27-
animated:
28-
'animate-[pulse_1.5s_ease-in-out_infinite] light:bg-gradient-to-r light:from-gray-200 light:via-gray-300 light:to-gray-200 dark:bg-gradient-to-r dark:from-gray-700 dark:via-gray-600 dark:to-gray-700 bg-[length:200%_100%]',
29-
variants: baseTheme.variants
30-
};
31-
32-
export const legacySkeletonTheme: SkeletonTheme = {
33-
...baseTheme,
34-
base: [baseTheme.base, 'bg-[var(--skeleton-background)]'].join(' '),
35-
animated:
36-
'animate-[pulse_1.5s_ease-in-out_infinite] bg-[var(--skeleton-gradient)] bg-[length:200%_100%]',
37-
variants: baseTheme.variants
38-
};

src/utils/Theme/themes/themeV9.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,17 @@ export const themeV9: ReablocksTheme = {
14391439
xl: 'h-6',
14401440
xxl: 'h-8'
14411441
}
1442+
},
1443+
skeleton: {
1444+
base: 'rounded-md light:bg-gray-200 dark:bg-gray-700',
1445+
animated:
1446+
'animate-[pulse_1.5s_ease-in-out_infinite] light:bg-gradient-to-r light:from-gray-200 light:via-gray-300 light:to-gray-200 dark:bg-gradient-to-r dark:from-gray-700 dark:via-gray-600 dark:to-gray-700 bg-[length:200%_100%]',
1447+
variants: {
1448+
text: 'h-4 w-full',
1449+
rounded: 'rounded-full w-10 h-10',
1450+
rectangle: 'h-24 w-full',
1451+
square: 'w-24 h-24'
1452+
}
14421453
}
14431454
}
14441455
};

0 commit comments

Comments
 (0)