Skip to content

Commit 300f8c2

Browse files
committed
feat: [#421] button transition when changing theme
1 parent 9319e3b commit 300f8c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/ColorModeSelector.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
>Change Themes</button>
1717
</div> -->
1818
<div>
19-
<button @click="$colorMode.preference = 'system'">
19+
<button v-if="$colorMode.preference === 'system'" @click="$colorMode.preference = 'dark'">
2020
<svg
2121
xmlns="http://www.w3.org/2000/svg"
2222
width="24"
@@ -41,7 +41,7 @@
4141
<line x1="12" y1="17" x2="12" y2="21" />
4242
</svg>
4343
</button>
44-
<button @click="$colorMode.preference = 'dark'">
44+
<button v-if="$colorMode.preference === 'dark'" @click="$colorMode.preference = 'light'">
4545
<svg
4646
xmlns="http://www.w3.org/2000/svg"
4747
width="24"
@@ -57,7 +57,7 @@
5757
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
5858
</svg>
5959
</button>
60-
<button @click="$colorMode.preference = 'light'">
60+
<button v-if="$colorMode.preference === 'light'" @click="$colorMode.preference = 'system'">
6161
<svg
6262
xmlns="http://www.w3.org/2000/svg"
6363
width="24"

0 commit comments

Comments
 (0)