feat(theme): 重构主题系统,新增 glass-pill 按钮样式

- ThemeConfig 接口扩展至 60+ 语义化属性
- 新增深浅主题预设 (glassPill overrides)
- button-group 支持 glass-pill 样式变体
- 默认主题改为浅色
- 移除 toolbar 容器硬编码定位
- 统一组件 CSS 变量命名规范
- 暂时隐藏下拉箭头
This commit is contained in:
yuding
2026-01-21 15:50:07 +08:00
parent 8d027419e4
commit 19f7e3ffbc
34 changed files with 6840 additions and 4706 deletions

View File

@@ -1,37 +1,29 @@
:root {
--bim-dialog-bg: rgba(17, 17, 17, 0.95);
--bim-dialog-header-bg: #2a2a2a;
--bim-dialog-title-color: #fff;
--bim-dialog-text-color: #ccc;
--bim-dialog-border-color: #444;
}
.bim-dialog {
position: absolute;
background-color: var(--bim-dialog-bg);
border: 1px solid var(--bim-dialog-border-color);
background-color: var(--bim-dialog-bg, var(--bim-bg-elevated));
border: 1px solid var(--bim-dialog-border-color, var(--bim-border-default));
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
box-shadow: var(--bim-shadow-lg);
display: flex;
flex-direction: column;
z-index: 10001; /* 提高 z-index确保在第三方 SDK (10000) 之上 */
color: var(--bim-dialog-title-color);
z-index: 10001;
color: var(--bim-dialog-title-color, var(--bim-text-primary));
overflow: hidden;
min-width: 200px;
min-height: 100px;
pointer-events: auto; /* 确保弹窗可以接收事件 */
pointer-events: auto;
}
.bim-dialog-header {
height: 32px;
background-color: var(--bim-dialog-header-bg);
background-color: var(--bim-dialog-header-bg, var(--bim-bg-inset));
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10px;
cursor: default;
user-select: none;
border-bottom: 1px solid var(--bim-dialog-border-color);
border-bottom: 1px solid var(--bim-dialog-border-color, var(--bim-border-default));
flex-shrink: 0;
}
@@ -51,20 +43,20 @@
.bim-dialog-close {
cursor: pointer;
font-size: 18px;
color: #999;
color: var(--bim-text-tertiary);
line-height: 1;
margin-left: 8px;
}
.bim-dialog-close:hover {
color: #fff;
color: var(--bim-text-primary);
}
.bim-dialog-content {
flex: 1;
overflow: auto;
font-size: 14px;
color: var(--bim-dialog-text-color);
color: var(--bim-dialog-text-color, var(--bim-text-secondary));
}
/* 缩放句柄 */
@@ -78,7 +70,6 @@
z-index: 10;
}
/* 右下角装饰,类似斜线 */
.bim-dialog-resize-handle::after {
content: '';
position: absolute;
@@ -86,10 +77,10 @@
right: 3px;
width: 6px;
height: 6px;
border-right: 2px solid #666;
border-bottom: 2px solid #666;
border-right: 2px solid var(--bim-text-tertiary);
border-bottom: 2px solid var(--bim-text-tertiary);
}
.bim-dialog-resize-handle:hover::after {
border-color: #fff;
border-color: var(--bim-text-primary);
}

View File

@@ -57,11 +57,19 @@ export class BimDialog implements IBimComponent {
*/
public setTheme(theme: ThemeConfig) {
const style = this.element.style;
if (!this.options.backgroundColor) style.setProperty('--bim-dialog-bg', theme.panelBackground);
if (!this.options.headerBackgroundColor) style.setProperty('--bim-dialog-header-bg', theme.componentHover);
if (!this.options.backgroundColor) style.setProperty('--bim-dialog-bg', theme.bgElevated);
if (!this.options.headerBackgroundColor) style.setProperty('--bim-dialog-header-bg', theme.bgInset);
if (!this.options.titleColor) style.setProperty('--bim-dialog-title-color', theme.textPrimary);
if (!this.options.textColor) style.setProperty('--bim-dialog-text-color', theme.textPrimary);
if (!this.options.borderColor) style.setProperty('--bim-dialog-border-color', theme.border);
if (!this.options.textColor) style.setProperty('--bim-dialog-text-color', theme.textSecondary);
if (!this.options.borderColor) style.setProperty('--bim-dialog-border-color', theme.borderDefault);
style.setProperty('--bim-bg-elevated', theme.bgElevated);
style.setProperty('--bim-bg-inset', theme.bgInset);
style.setProperty('--bim-text-primary', theme.textPrimary);
style.setProperty('--bim-text-secondary', theme.textSecondary);
style.setProperty('--bim-text-tertiary', theme.textTertiary);
style.setProperty('--bim-border-default', theme.borderDefault);
style.setProperty('--bim-shadow-lg', theme.shadowLg);
}
/**