Skip to content

Commit

Permalink
fix theme color on firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemhosny committed Nov 23, 2024
1 parent fe21781 commit 8ecccd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/livecodes/UI/theme-colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export const themeColors = [
{ name: 'violet', themeColor: 'hsl(262, 40%, 50%)' },
{ name: 'slate', themeColor: 'hsl(220, 20%, 50%)' },
{ name: 'custom', themeColor: undefined },
];
] as const;
3 changes: 3 additions & 0 deletions src/livecodes/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,9 @@ const getDefaultColor = () => {
if (theme === 'light') {
root.classList.add('light');
}
if (h === '' || s === '' || l === '') {
return themeColors[0].themeColor;
}
defaultColor = `hsl(${h}, ${s}, ${l})`;
return defaultColor;
};
Expand Down

0 comments on commit 8ecccd6

Please sign in to comment.