Skip to content

Commit afd3f02

Browse files
✨ Refactor theme toggle component for improved sizing and transition effects
1 parent e1d0e53 commit afd3f02

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

resources/views/components/theme-toggle.blade.php

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div
2-
class="theme-selector relative h-11 w-11 cursor-pointer select-none hover:text-slate-600 dark:text-[#ABB0DD] dark:hover:text-[#bcc1ef]"
2+
class="theme-selector relative h-10 w-10 cursor-pointer select-none hover:text-slate-600 dark:text-[#ABB0DD] dark:hover:text-[#bcc1ef]"
33
x-on:click="darkMode = !darkMode"
44
x-data="{
55
nightToDay: [
@@ -128,8 +128,7 @@ class="theme-selector-moon absolute right-1/2 top-1/2 -translate-y-1/2 translate
128128
<div class="-scale-x-100 transition duration-300">
129129
<svg
130130
xmlns="http://www.w3.org/2000/svg"
131-
width="24"
132-
height="24"
131+
class="size-[22px]"
133132
viewBox="0 0 16 16"
134133
>
135134
<path
@@ -144,8 +143,7 @@ class="theme-selector-moon absolute right-1/2 top-1/2 -translate-y-1/2 translate
144143
<div class="transition duration-300">
145144
<svg
146145
xmlns="http://www.w3.org/2000/svg"
147-
width="7"
148-
height="7"
146+
class="size-[7px]"
149147
viewBox="0 0 256 256"
150148
>
151149
<path
@@ -160,8 +158,7 @@ class="theme-selector-moon absolute right-1/2 top-1/2 -translate-y-1/2 translate
160158
<div class="transition duration-300">
161159
<svg
162160
xmlns="http://www.w3.org/2000/svg"
163-
width="5"
164-
height="5"
161+
class="size-[5px]"
165162
viewBox="0 0 256 256"
166163
>
167164
<path
@@ -175,7 +172,7 @@ class="theme-selector-moon absolute right-1/2 top-1/2 -translate-y-1/2 translate
175172
<div class="absolute right-1/2 top-1/2 -translate-y-1/2 translate-x-1/2">
176173
<div class="theme-selector-sunball">
177174
<div
178-
class="h-4 w-4 rounded-full bg-current transition duration-300"
175+
class="size-3.5 rounded-full bg-current transition duration-300"
179176
></div>
180177
</div>
181178
</div>
@@ -184,36 +181,36 @@ class="h-4 w-4 rounded-full bg-current transition duration-300"
184181
<div class="relative h-full w-full">
185182
{{-- Top --}}
186183
<div
187-
class="absolute right-1/2 top-[0.5rem] h-[0.22rem] w-0.5 translate-x-1/2 rounded-full bg-current transition duration-300"
184+
class="absolute right-1/2 top-[0.45rem] h-[3.5px] w-[2px] translate-x-1/2 rounded-full bg-current transition duration-300"
188185
></div>
189186
{{-- Right --}}
190187
<div
191-
class="absolute right-[0.5rem] top-1/2 h-[0.22rem] w-0.5 -translate-y-1/2 rotate-[90deg] rounded-full bg-current transition duration-300"
188+
class="absolute right-[0.45rem] top-1/2 h-[3.5px] w-[2px] -translate-y-1/2 rotate-[90deg] rounded-full bg-current transition duration-300"
192189
></div>
193190
{{-- Bottom --}}
194191
<div
195-
class="absolute bottom-[0.5rem] right-1/2 h-[0.22rem] w-0.5 translate-x-1/2 rounded-full bg-current transition duration-300"
192+
class="absolute bottom-[0.45rem] right-1/2 h-[3.5px] w-[2px] translate-x-1/2 rounded-full bg-current transition duration-300"
196193
></div>
197194
{{-- Left --}}
198195
<div
199-
class="absolute left-[0.5rem] top-1/2 h-[0.22rem] w-0.5 -translate-y-1/2 rotate-[90deg] rounded-full bg-current transition duration-300"
196+
class="absolute left-[0.45rem] top-1/2 h-[3.5px] w-[2px] -translate-y-1/2 rotate-[90deg] rounded-full bg-current transition duration-300"
200197
></div>
201198
{{-- Top Right --}}
202199
<div
203-
class="absolute right-[0.75rem] top-[0.75rem] h-[0.22rem] w-0.5 rotate-[45deg] rounded-full bg-current transition duration-300"
200+
class="absolute right-[0.7rem] top-[0.7rem] h-[3.5px] w-[2px] rotate-[45deg] rounded-full bg-current transition duration-300"
204201
></div>
205202
{{-- Top Left --}}
206203
<div
207-
class="absolute left-[0.75rem] top-[0.75rem] h-[0.22rem] w-0.5 rotate-[-45deg] rounded-full bg-current transition duration-300"
204+
class="absolute left-[0.7rem] top-[0.7rem] h-[3.5px] w-[2px] rotate-[-45deg] rounded-full bg-current transition duration-300"
208205
></div>
209206

210207
{{-- Bottom Right --}}
211208
<div
212-
class="absolute bottom-[0.75rem] right-[0.75rem] h-[0.22rem] w-0.5 rotate-[-45deg] rounded-full bg-current transition duration-300"
209+
class="absolute bottom-[0.7rem] right-[0.7rem] h-[3.5px] w-[2px] rotate-[-45deg] rounded-full bg-current transition duration-300"
213210
></div>
214211
{{-- Bottom Left --}}
215212
<div
216-
class="absolute bottom-[0.75rem] left-[0.75rem] h-[0.22rem] w-0.5 rotate-[45deg] rounded-full bg-current transition duration-300"
213+
class="absolute bottom-[0.7rem] left-[0.7rem] h-[3.5px] w-[2px] rotate-[45deg] rounded-full bg-current transition duration-300"
217214
></div>
218215
</div>
219216
</div>

0 commit comments

Comments
 (0)