Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue committed Jan 16, 2025
1 parent c6eef4c commit b88930a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/toggle.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Props = HTMLAttributes<'button'>
const props: Props = Astro.props
---

<button id="astro-theme-toggle" class="astro-theme-toggle" {...props}>
<button id="astro-theme-toggle" {...props}>
<div class="astro-theme-toggle-icon-light">
<slot name="icon-light">
<IconSunSvg />
Expand All @@ -33,7 +33,7 @@ const props: Props = Astro.props
</script>

<style is:global>
.astro-theme-toggle {
:where(#astro-theme-toggle) {
padding: 0;
margin: 0;
border: none;
Expand Down
18 changes: 8 additions & 10 deletions website/components/theme-toggle-button-custom.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
import { Toggle } from 'astro-theme-toggle'
---

<div style="width: 64px; height: 64px;">
<Toggle>
<Fragment slot="icon-light">
<span style="font-size: 64px;">🌞</span>
</Fragment>
<Fragment slot="icon-dark">
<span style="font-size: 64px;">🌚</span>
</Fragment>
</Toggle>
</div>
<Toggle style="width: 64px; height: 64px;">
<Fragment slot="icon-light">
<span style="font-size: 64px;">🌞</span>
</Fragment>
<Fragment slot="icon-dark">
<span style="font-size: 64px;">🌚</span>
</Fragment>
</Toggle>
11 changes: 8 additions & 3 deletions website/components/theme-toggle-button.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
import { Toggle } from 'astro-theme-toggle'
---

<div style="width: 24px; height: 24px;">
<Toggle />
</div>
<Toggle class="theme-toggle" />

<style>
.theme-toggle {
width: 24px;
height: 24px;
}
</style>

0 comments on commit b88930a

Please sign in to comment.