pl-fe: fix theme configuration?

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk
2025-01-14 09:38:22 +01:00
parent ba6976349c
commit cc4d600cd0
3 changed files with 18 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ const DEFAULT_COLORS = {
const normalizeColors = (theme: Partial<Pick<PlFeConfig, 'brandColor' | 'accentColor' | 'colors'>>) => {
const brandColor: string = theme.brandColor || theme.colors?.primary?.['500'] || '#d80482';
const accentColor: string = theme.accentColor || theme.colors?.accent?.['500'] || '' || generateAccent(brandColor);
const accentColor: string = theme.accentColor || theme.colors?.accent?.['500'] || generateAccent(brandColor) || '';
const colors = {
...theme.colors,
@@ -48,6 +48,7 @@ const normalizeColors = (theme: Partial<Pick<PlFeConfig, 'brandColor' | 'accentC
const normalizedColors = toTailwind({
brandColor,
accentColor,
// @ts-ignore
colors,
});
@@ -82,4 +83,4 @@ const useThemeCss = (overwriteConfig?: PlFeConfig) => {
}, [demo, plFeConfig, theme]);
};
export { useThemeCss };
export { normalizeColors, useThemeCss };