-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
947deb6
commit 041656e
Showing
8 changed files
with
85 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/app export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ tempCodeRunnerFile.* | |
.release-it.json | ||
.github | ||
.vscode | ||
.gitattributes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import "./tailwind.css"; | ||
import ShadcnThemeEditor from "./components/editor-open"; | ||
import { setSavedTheme } from "./lib/set-saved-theme"; | ||
export { Icons } from "./components/icons"; | ||
|
||
export { setSavedTheme }; | ||
export default ShadcnThemeEditor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { LOCAL_STORAGE_KEY } from "./consts"; | ||
import { themeEmittor } from "./emittors"; | ||
import { type ThemeWithHSLColor } from "./theme"; | ||
import { ls, ZodTheme } from "./utils"; | ||
|
||
export function setSavedTheme(theme: string | undefined){ | ||
let lsTheme = ls.getLocalStorageItem<ThemeWithHSLColor[]>( | ||
LOCAL_STORAGE_KEY + ":" + theme | ||
); | ||
if (lsTheme) { | ||
try { | ||
const isValid = ZodTheme.parse(lsTheme); | ||
themeEmittor.applyTheme(lsTheme); | ||
return true; | ||
} catch (error) { | ||
// localStorage.removeItem(LOCAL_STORAGE_KEY+":"+currentTheme); //* remove key | ||
} | ||
} | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters