Skip to content

Commit db95add

Browse files
authored
Merge pull request #10 from jlsnow301/typed-props
Fixes prop types in themeswitch component
2 parents ccfb3dd + e4cfd7c commit db95add

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "astro-color-scheme",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Perfect dark mode for Astro in few lines of code. Theme Toggle for Dark, Light & Auto (system)",
55
"type": "module",
66
"exports": {

src/ThemeSwitch.astro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
interface Props {
3-
strategy?: "button" | "checkbox" | "select" | "radio";
4-
defaultTheme?: "dark" | "light" | "system";
5-
as?: "div" | "span";
6-
}
2+
type Props = Partial<{
3+
as: "div" | "span";
4+
defaultTheme: "dark" | "light" | "system";
5+
strategy: "button" | "checkbox" | "select" | "radio";
6+
}>;
77
8-
const { strategy, defaultTheme, as: Element = "span" } = Astro.props;
8+
const { strategy, defaultTheme, as: Element = "span" }: Props = Astro.props;
99
---
1010

1111
<Element id="astro-color-scheme-switch">

0 commit comments

Comments
 (0)