MediaWiki:Gadget-ThemeSwitch.css
外观
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* ThemeSwitch gadget — floating picker */
#theme-picker {
position: fixed;
bottom: 5.5rem;
right: 1.2rem;
z-index: 9999;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#theme-toggle-btn {
width: 42px;
height: 42px;
border-radius: 50%;
border: 2px solid rgba(255,255,255,0.6);
box-shadow: 0 3px 12px rgba(0,0,0,0.25);
cursor: pointer;
font-size: 1.2em;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s, box-shadow 0.2s;
outline: none;
}
#theme-toggle-btn:hover {
transform: scale(1.1);
box-shadow: 0 5px 18px rgba(0,0,0,0.3);
}
#theme-picker-menu {
position: absolute;
bottom: 52px;
right: 0;
background: #fff;
border-radius: 12px;
box-shadow: 0 8px 30px rgba(0,0,0,0.18);
padding: 0.6em;
min-width: 130px;
display: none;
flex-direction: column;
gap: 0.3em;
border: 1px solid rgba(0,0,0,0.08);
}
#theme-picker-menu.open {
display: flex;
}
.theme-picker-heading {
font-size: 0.72em;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #999;
padding: 0.2em 0.5em 0.4em;
font-weight: 600;
}
.theme-option {
display: flex;
align-items: center;
gap: 0.6em;
padding: 0.45em 0.7em;
border: none;
background: none;
border-radius: 8px;
cursor: pointer;
font-size: 0.9em;
color: #333;
text-align: left;
width: 100%;
transition: background 0.15s;
}
.theme-option:hover {
background: #f0f4f8;
}
.theme-swatch {
width: 18px;
height: 18px;
border-radius: 50%;
flex-shrink: 0;
display: inline-block;
}
/* Dark theme: make the menu itself dark */
html.theme-dark #theme-picker-menu {
background: #252836;
border-color: #2d3748;
color: #e2e8f0;
}
html.theme-dark .theme-option { color: #e2e8f0; }
html.theme-dark .theme-option:hover { background: #2d3748; }
html.theme-dark .theme-picker-heading { color: #718096; }
/* Warm theme */
html.theme-warm #theme-picker-menu {
background: #faf6ef;
border-color: #e8dcc8;
}
html.theme-warm .theme-option { color: #3d2b0f; }
html.theme-warm .theme-option:hover { background: #f5ede0; }