iter(g08): 新增 segmented 分段控制器组件
This commit is contained in:
@@ -1754,3 +1754,65 @@ button.ua-step-dot:hover {
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* —— 分段控制器:胶囊容器 + 滑动滑块,选中态低视觉比重 —— */
|
||||
.ua-segmented {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
border: 1px solid var(--ua-color-border);
|
||||
border-radius: 999px;
|
||||
background: color-mix(in srgb, var(--ua-color-text) 4%, transparent);
|
||||
overflow: hidden;
|
||||
}
|
||||
.ua-seg-thumb {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
border-radius: 999px;
|
||||
background: var(--ua-color-bg);
|
||||
box-shadow: 0 1px 4px color-mix(in srgb, var(--ua-color-text) 12%, transparent);
|
||||
transition: transform 0.18s ease, width 0.18s ease;
|
||||
pointer-events: none;
|
||||
}
|
||||
.ua-seg-btn {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 5px 14px;
|
||||
border: 0;
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
color: var(--ua-color-text-muted);
|
||||
font-size: var(--ua-font-size-md);
|
||||
cursor: pointer;
|
||||
transition: color 0.15s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.ua-seg-btn:hover:not(:disabled) {
|
||||
color: var(--ua-color-text);
|
||||
}
|
||||
.ua-seg-btn:focus-visible {
|
||||
outline: 2px solid var(--ua-color-accent);
|
||||
outline-offset: -2px;
|
||||
}
|
||||
.ua-seg-btn.is-active {
|
||||
color: var(--ua-color-accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
.ua-seg-btn:disabled {
|
||||
color: color-mix(in srgb, var(--ua-color-text-muted) 45%, transparent);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.ua-segmented-sm .ua-seg-btn {
|
||||
padding: 3px 10px;
|
||||
font-size: var(--ua-font-size-sm);
|
||||
}
|
||||
.ua-segmented.is-disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ua-seg-thumb,
|
||||
.ua-seg-btn {
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user