Skip to content

Commit 9c4fce8

Browse files
committed
fix preference switch on narrow screen
1 parent 0e472e6 commit 9c4fce8

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/.vitepress/theme/components/PreferenceSwitch.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function useToggleFn(
118118
119119
.vt-link-icon {
120120
position: relative;
121-
top: 2px;
121+
top: 1px;
122122
}
123123
124124
#preference-switches {
@@ -140,7 +140,8 @@ function useToggleFn(
140140
}
141141
142142
.vt-switch {
143-
margin-right: 12px;
143+
margin-right: 5px;
144+
transform: scale(0.8);
144145
}
145146
146147
.switch-container label {
@@ -149,7 +150,7 @@ function useToggleFn(
149150
}
150151
151152
.switch-container label:first-child {
152-
width: 56px;
153+
width: 50px;
153154
}
154155
155156
.switch-link {
@@ -163,6 +164,16 @@ function useToggleFn(
163164
border: 1px solid var(--vt-c-green);
164165
border-radius: 50%;
165166
}
167+
168+
@media (max-width: 1440px) {
169+
#preference-switches {
170+
font-size: 11px;
171+
padding: 8px 12px;
172+
}
173+
.switch-container label:first-child {
174+
width: 46px;
175+
}
176+
}
166177
</style>
167178

168179
<style>

0 commit comments

Comments
 (0)