1414 <a href =" https://slack.feast.dev/" class =" nav-item" >COMMUNITY</a >
1515 </div >
1616
17- <button class =" mobile-menu-button" id =" mobile-menu-button" >
18- <svg width =" 24" height =" 24" fill =" none" stroke =" currentColor" viewBox =" 0 0 24 24" >
19- <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M4 6h16M4 12h16M4 18h16" ></path >
20- </svg >
21- </button >
17+ <div class =" nav-right" >
18+ <button class =" theme-toggle" id =" theme-toggle" aria-label =" Toggle dark mode" >
19+ <svg class =" icon-sun" width =" 18" height =" 18" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" stroke-linecap =" round" stroke-linejoin =" round" >
20+ <circle cx =" 12" cy =" 12" r =" 5" ></circle >
21+ <line x1 =" 12" y1 =" 1" x2 =" 12" y2 =" 3" ></line >
22+ <line x1 =" 12" y1 =" 21" x2 =" 12" y2 =" 23" ></line >
23+ <line x1 =" 4.22" y1 =" 4.22" x2 =" 5.64" y2 =" 5.64" ></line >
24+ <line x1 =" 18.36" y1 =" 18.36" x2 =" 19.78" y2 =" 19.78" ></line >
25+ <line x1 =" 1" y1 =" 12" x2 =" 3" y2 =" 12" ></line >
26+ <line x1 =" 21" y1 =" 12" x2 =" 23" y2 =" 12" ></line >
27+ <line x1 =" 4.22" y1 =" 19.78" x2 =" 5.64" y2 =" 18.36" ></line >
28+ <line x1 =" 18.36" y1 =" 5.64" x2 =" 19.78" y2 =" 4.22" ></line >
29+ </svg >
30+ <svg class =" icon-moon" width =" 18" height =" 18" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" stroke-linecap =" round" stroke-linejoin =" round" >
31+ <path d =" M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" ></path >
32+ </svg >
33+ </button >
34+ <button class =" mobile-menu-button" id =" mobile-menu-button" >
35+ <svg width =" 24" height =" 24" fill =" none" stroke =" currentColor" viewBox =" 0 0 24 24" >
36+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M4 6h16M4 12h16M4 18h16" ></path >
37+ </svg >
38+ </button >
39+ </div >
2240 </div >
2341
2442 <div class =" mobile-menu" id =" mobile-menu" >
3856 top: 0;
3957 left: 0;
4058 right: 0;
41- background-color: white ;
59+ background-color: var(--color-nav-bg) ;
4260 z-index: 1000;
4361 }
4462
8098 margin-left: 32px;
8199 }
82100
101+ .nav-right {
102+ display: flex;
103+ align-items: center;
104+ gap: 4px;
105+ padding-right: var(--content-padding);
106+ }
107+
108+ .theme-toggle {
109+ background: none;
110+ border: none;
111+ padding: 8px;
112+ cursor: pointer;
113+ color: var(--color-text);
114+ display: flex;
115+ align-items: center;
116+ justify-content: center;
117+ opacity: 0.7;
118+ transition: opacity 0.2s ease;
119+ }
120+
121+ .theme-toggle:hover {
122+ opacity: 1;
123+ }
124+
125+ .icon-sun { display: none; }
126+ .icon-moon { display: block; }
127+ :global([data-theme="dark"]) .icon-sun { display: block; }
128+ :global([data-theme="dark"]) .icon-moon { display: none; }
129+
83130 .mobile-menu-button {
84131 display: block;
85132 background: none;
86133 border: none;
87134 padding: 8px;
88135 cursor: pointer;
89136 color: var(--color-text);
90- margin-right: var(--content-padding);
91137 }
92138
93139 @media (min-width: 1024px) {
94140 .desktop-menu {
95141 display: flex;
96142 align-items: center;
97143 }
98-
144+
99145 .mobile-menu-button {
100146 display: none;
101147 }
104150 .mobile-menu {
105151 display: none;
106152 width: 100%;
107- background: white ;
153+ background: var(--color-nav-bg) ;
108154 padding: 16px 0;
109- border-top: 1px solid #eee ;
155+ border-top: 1px solid var(--color-border) ;
110156 position: absolute;
111157 top: 52px;
112158 left: 0;
122168 }
123169
124170 .mobile-menu a:hover {
125- background-color: #f5f5f5 ;
171+ background-color: var(--color-nav-hover) ;
126172 }
127173</style >
128174
129175<script >
130176 const menuButton = document.getElementById('mobile-menu-button');
131177 const mobileMenu = document.getElementById('mobile-menu');
132-
178+
133179 if (menuButton && mobileMenu) {
134180 menuButton.addEventListener('click', () => {
135181 mobileMenu.classList.toggle('active');
136182 });
137183 }
184+
185+ const themeToggle = document.getElementById('theme-toggle');
186+ if (themeToggle) {
187+ themeToggle.addEventListener('click', () => {
188+ const current = document.documentElement.getAttribute('data-theme');
189+ const next = current === 'dark' ? 'light' : 'dark';
190+ document.documentElement.setAttribute('data-theme', next);
191+ localStorage.setItem('theme', next);
192+ });
193+ }
138194</script >
0 commit comments