提交 e1e812c9 authored 作者: 陈泽健's avatar 陈泽健

style(service-monitor): toggle 开关样式优化

增大尺寸(52x28)、加深禁用色(#d1d5db)、添加边框、
圆点阴影、hover 外发光,提升视觉对比度和可点击暗示。
Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
上级 ff9181c9
...@@ -17,12 +17,14 @@ ...@@ -17,12 +17,14 @@
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--gray-100); } .toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.toggle-row:last-child { border-bottom: none; } .toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; color: var(--gray-700); } .toggle-label { font-size: 14px; color: var(--gray-700); }
.toggle-switch { position: relative; width: 48px; height: 26px; cursor: pointer; } .toggle-switch { position: relative; width: 52px; height: 28px; cursor: pointer; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; } .toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--gray-300); border-radius: 13px; transition: .2s; pointer-events: none; } .toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #d1d5db; border-radius: 14px; transition: all 0.2s ease; pointer-events: none; border: 1px solid #9ca3af; }
.toggle-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; pointer-events: none; } .toggle-slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 2px; bottom: 2px; background: #fff; border-radius: 50%; transition: all 0.2s ease; pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); } .toggle-switch input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); } .toggle-switch input:checked + .toggle-slider:before { transform: translateX(24px); }
.toggle-switch:hover .toggle-slider { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2); }
.toggle-switch input:checked + .toggle-slider:hover { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3); }
.btn-test { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; } .btn-test { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-test:hover { background: var(--gray-200); } .btn-test:hover { background: var(--gray-200); }
.btn-test:disabled { opacity: .5; cursor: not-allowed; } .btn-test:disabled { opacity: .5; cursor: not-allowed; }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论