Skip to content

Commit b379bc6

Browse files
committed
Add benchmarking for theme variable conversion; update Cargo.toml
1 parent a367e6f commit b379bc6

File tree

10 files changed

+417
-32
lines changed

10 files changed

+417
-32
lines changed

.changeset/bright-carrots-float.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@devup-ui/wasm": patch
3+
---
4+
5+
Optimize to convert theme var

Cargo.lock

Lines changed: 240 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/landing/src/components/Header/ThemeSwitch.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { Box, getTheme, setTheme } from '@devup-ui/react'
3+
import { Box, css, getTheme, setTheme } from '@devup-ui/react'
44

55
export function ThemeSwitch() {
66
return (
@@ -13,6 +13,11 @@ export function ThemeSwitch() {
1313
}}
1414
>
1515
<svg
16+
className={css({
17+
_themeDark: {
18+
display: 'none',
19+
},
20+
})}
1621
fill="none"
1722
height="24"
1823
viewBox="0 0 24 24"
@@ -26,6 +31,24 @@ export function ThemeSwitch() {
2631
fillRule="evenodd"
2732
/>
2833
</svg>
34+
<svg
35+
className={css({
36+
display: 'none',
37+
_themeDark: {
38+
display: 'initial',
39+
},
40+
})}
41+
fill="none"
42+
height="24"
43+
viewBox="0 0 24 24"
44+
width="24"
45+
xmlns="http://www.w3.org/2000/svg"
46+
>
47+
<path
48+
d="M12.1114 5.00087C12.5233 5.0073 12.5857 5.6006 12.2423 5.82807C10.8911 6.7231 10 8.25745 10 10C10 12.7614 12.2378 15 14.9982 15C16.0365 15 17.0009 14.6832 17.8001 14.141C18.1405 13.9101 18.6624 14.193 18.511 14.5755C17.485 17.167 14.9566 19 12 19C8.13401 19 5 15.866 5 12C5 8.13401 8.13401 5 12 5C12.0372 5 12.0744 5.00029 12.1114 5.00087Z"
49+
fill="currentColor"
50+
/>
51+
</svg>
2952
</Box>
3053
)
3154
}

0 commit comments

Comments
 (0)