1
1
<div class =" flex flex-col space-y-2 lg:space-y-0 lg:flex-row lg:space-x-6 xl:space-x-8 lg:items-center" >
2
2
<a class =" text-primary hover:underline" href =" /" >Home</a >
3
- <a class =" text-gray-500 hover:text-primary hover:underline" href =" /components" >Components</a >
4
- <a class =" text-gray-500 hover:text-primary hover:underline" href =" #" >Featured</a >
5
- <a class =" text-gray-500 hover:text-primary hover:underline" href =" #" >Blog</a >
6
- <a class =" text-gray-500 hover:text-primary hover:underline" href =" #" >Cheatsheet</a >
3
+ <a class =" text-gray-500 dark:text-gray-200 hover:text-primary hover:underline" href =" /components" >Components</a >
4
+ <a class =" text-gray-500 dark:text-gray-200 hover:text-primary hover:underline" href =" #" >Featured</a >
5
+ <a class =" text-gray-500 dark:text-gray-200 hover:text-primary hover:underline" href =" #" >Blog</a >
6
+ <a class =" text-gray-500 dark:text-gray-200 hover:text-primary hover:underline" href =" #" >Cheatsheet</a >
7
7
</div >
8
8
9
9
<div class =" flex flex-col space-y-4 lg:space-y-0 lg:flex-row lg:items-center lg:space-x-4" >
10
- <button class =" flex justify-center py-2 bg-gray-100 rounded-md lg:bg-transparent lg:p-2 hover:bg-gray-100 focus:bg-gray-100 focus:outline-none" >
11
- <svg class =" w-5 h-5 text-gray-500" viewBox =" 0 0 20 20" fill =" currentColor" >
12
- <path fill-rule =" evenodd" d =" M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z" clip-rule =" evenodd" />
13
- </svg >
10
+ <button x-data =" ToggleDark()" x-init =" created()" title =" Dark Mode" @click .prevent =" toggle()" class =" flex justify-center py-2 text-gray-500 bg-gray-100 rounded-md dark:text-gray-200 dark:bg-gray-800 lg:dark:bg-transparent lg:bg-transparent lg:p-2 hover:bg-gray-100 focus:bg-gray-100 dark:hover:bg-gray-800 dark:focus:bg-gray-800 focus:outline-none" >
11
+ <svg x-show =" darkMode" class =" w-5 h-5" xmlns =" http://www.w3.org/2000/svg" viewBox =" 0 0 20 20" fill =" currentColor" >
12
+ <path fill-rule =" evenodd" d =" M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z" clip-rule =" evenodd" />
13
+ </svg >
14
+
15
+ <svg x-show =" !darkMode" class =" w-5 h-5 transform -rotate-90" xmlns =" http://www.w3.org/2000/svg" viewBox =" 0 0 20 20" fill =" currentColor" >
16
+ <path d =" M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" />
17
+ </svg >
14
18
</button >
15
19
16
20
<a href =" #" class =" px-4 py-2 text-sm font-semibold text-center text-white rounded-md bg-primary hover:bg-teal-300" >
17
21
Submit new component
18
22
</a >
19
23
20
- <div class =" relative" @mouseover = " dropdown = true " @mouseover .away =" dropdown = false" x-data =" { dropdown: false }" >
24
+ <div class =" relative" @click .away =" dropdown = false" x-data =" { dropdown: false }" >
21
25
<!-- Dropdown toggle button -->
22
- <button class =" flex items-center justify-center space-x-2 focus:outline-none" >
26
+ <button @click = " dropdown = !dropdown " class =" flex items-center justify-center space-x-2 focus:outline-none" >
23
27
<img class =" object-cover w-8 h-8 border-2 rounded-full border-primary lg:w-10 lg:h-10 " src =" https://images.unsplash.com/photo-1502767882403-636aee14f873?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80" alt =" avatar" >
24
- <span class =" font-medium text-gray-800 lg:hidden" >Jane Doe</span >
28
+ <span class =" font-medium text-gray-800 dark:text-gray-200 lg:hidden" >Jane Doe</span >
25
29
</button >
26
30
27
31
<!-- Dropdown menu -->
33
37
x-transition:leave =" transition ease-in duration-75 transform"
34
38
x-transition:leave-start =" opacity-100 scale-100"
35
39
x-transition:leave-end =" opacity-0 scale-95"
36
- class =" absolute left-0 z-20 w-48 py-1 mt-2 bg-white border border-gray-100 rounded-md shadow-xl lg:left-auto lg:right-0 dark:bg-gray-800" >
40
+ class =" absolute left-0 z-20 w-48 py-1 mt-2 bg-white border border-gray-100 rounded-md shadow-xl dark:border-gray-700 lg:left-auto lg:right-0 dark:bg-gray-800" >
37
41
<a href =" /profile" class =" block px-4 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 transform dark:text-gray-300 hover:bg-primary hover:text-white dark:hover:text-white" >
38
42
your profile
39
43
</a >
@@ -46,7 +50,8 @@ class="absolute left-0 z-20 w-48 py-1 mt-2 bg-white border border-gray-100 round
46
50
Settings
47
51
</a >
48
52
49
- <hr >
53
+ <hr class =" dark:border-gray-700" >
54
+
50
55
<a href =" #" class =" block px-4 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 transform dark:text-gray-300 hover:bg-primary hover:text-white dark:hover:text-white" >
51
56
Log Out
52
57
</a >
0 commit comments