Skip to content

Commit 655e74f

Browse files
committed
feat(dashboard): 主题化裸 checkbox/radio(修原生蓝勾选框)
模型选择器弹窗等处的勾选框是浏览器原生蓝色,与深色主题不搭。一段 全局 CSS 用 appearance:none 直接美化所有裸 input[type=checkbox|radio] (排除已有样式的 .switch/.checkbox/.segmented),一次覆盖现有+未来: - checkbox 方框+白勾(复用 .checkbox .box::after 勾形),radio 圆框白心点 - :checked→accent 色 / :hover→accent 边 / :focus-visible→accent ring(a11y) / :disabled 降透明;亮暗主题走 CSS 变量自动适配 - 立即修好:模型选择器 18 勾选框 / 批量池选择 / blocked-models 编辑器 / 各设置项裸 checkbox 审计:select/number/text/textarea/toggle 早已主题化,唯一缺口就是裸 checkbox/radio。纯 CSS 零依赖,不逐个改 markup。 验证:CDP(appearance:none + 16px + :checked bg=accent 精确匹配 + 零异常)/ 2639-0 绿 / i18n+inline-sync 门禁过。
1 parent 75a267b commit 655e74f

2 files changed

Lines changed: 62 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "windsurf-api",
3-
"version": "3.3.1",
3+
"version": "3.3.2",
44
"description": "Windsurf/Devin to OpenAI + Anthropic + Gemini compatible API proxy. Turns Devin's 100+ AI models (Claude, GPT, Gemini, DeepSeek, Grok, Qwen, Kimi, GLM, SWE) into multi-protocol API endpoints. Zero npm runtime dependencies (image codecs vendored under src/vendor).",
55
"type": "module",
66
"main": "src/index.js",

src/dashboard/index.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,67 @@
859859
}
860860
.checkbox:hover .box { border-color: var(--accent); }
861861

862+
/* Themed bare checkbox / radio. Paints EVERY raw <input type=checkbox|radio>
863+
that is NOT already wrapped by a styled component (.switch toggle, .checkbox
864+
with .box, .segmented radiogroup — those hide the native input via opacity:0
865+
and draw their own control). One rule themes the model picker, batch-select,
866+
blocked-models editor, and every settings checkbox at once — existing and
867+
future — with no per-element markup. Uses theme vars so light/dark both work. */
868+
input[type=checkbox]:not(.switch input):not(.checkbox input),
869+
input[type=radio]:not(.segmented input) {
870+
appearance: none;
871+
-webkit-appearance: none;
872+
width: 16px;
873+
height: 16px;
874+
margin: 0;
875+
flex-shrink: 0;
876+
vertical-align: -3px;
877+
border: 1.5px solid var(--border-strong);
878+
background: var(--bg-elev);
879+
cursor: pointer;
880+
transition: background .15s, border-color .15s, box-shadow .15s;
881+
position: relative;
882+
}
883+
input[type=checkbox]:not(.switch input):not(.checkbox input) { border-radius: 4px; }
884+
input[type=radio]:not(.segmented input) { border-radius: 50%; }
885+
input[type=checkbox]:not(.switch input):not(.checkbox input):hover,
886+
input[type=radio]:not(.segmented input):hover { border-color: var(--accent); }
887+
input[type=checkbox]:not(.switch input):not(.checkbox input):checked,
888+
input[type=radio]:not(.segmented input):checked {
889+
background: var(--accent);
890+
border-color: var(--accent);
891+
}
892+
/* checkbox tick (matches .checkbox .box::after) */
893+
input[type=checkbox]:not(.switch input):not(.checkbox input):checked::after {
894+
content: '';
895+
position: absolute;
896+
left: 4px; top: 1px;
897+
width: 4px; height: 8px;
898+
border: solid #fff;
899+
border-width: 0 2px 2px 0;
900+
transform: rotate(45deg);
901+
}
902+
/* radio inner dot */
903+
input[type=radio]:not(.segmented input):checked::after {
904+
content: '';
905+
position: absolute;
906+
left: 50%; top: 50%;
907+
width: 6px; height: 6px;
908+
border-radius: 50%;
909+
background: #fff;
910+
transform: translate(-50%, -50%);
911+
}
912+
input[type=checkbox]:not(.switch input):not(.checkbox input):focus-visible,
913+
input[type=radio]:not(.segmented input):focus-visible {
914+
outline: none;
915+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
916+
}
917+
input[type=checkbox]:not(.switch input):not(.checkbox input):disabled,
918+
input[type=radio]:not(.segmented input):disabled {
919+
opacity: .45;
920+
cursor: not-allowed;
921+
}
922+
862923
/* Tab-style radio group */
863924
.segmented {
864925
display: inline-flex;

0 commit comments

Comments
 (0)