fix(样式): 修复暗黑主题下评论组件边框显示问题
修复评论组件在暗黑主题下边框显示异常的问题: - 移除评论头部的固定底部边框,改由主题变量控制 - 修正主题变量作用域,确保变量在容器内生效 - 优化主题初始化逻辑,默认使用亮色主题 - 添加主题切换监听,支持动态切换亮色/暗黑主题
This commit is contained in:
@@ -126,9 +126,8 @@ export class CWDComments {
|
||||
this.mountPoint = document.createElement('div');
|
||||
this.mountPoint.className = 'cwd-comments-container';
|
||||
this.shadowRoot.appendChild(this.mountPoint);
|
||||
if (this.config.theme) {
|
||||
this.mountPoint.setAttribute('data-theme', this.config.theme);
|
||||
}
|
||||
const theme = this.config.theme || 'light';
|
||||
this.mountPoint.setAttribute('data-theme', theme);
|
||||
this._applyCustomCss();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user