Skip to content

Commit

Permalink
feat: CollapsePanel 新增css变量,并修改 title 默认字号
Browse files Browse the repository at this point in the history
  • Loading branch information
kwzm committed Jan 21, 2025
1 parent ddc53ad commit b7fd330
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
File renamed without changes.
12 changes: 10 additions & 2 deletions packages/bui-core/src/CollapsePanel/CollapsePanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
--bui-collapse-panel-content-padding,
var(--bui-spacing-lg) 0
);
--title-font-size: var(
--bui-collapse-panel-title-font-size,
var(--bui-title-size-3)
);
--content-font-size: var(
--bui-collapse-panel-content-font-size,
var(--bui-text-size-1)
);

width: var(--width);
background-color: var(--bui-color-bg-view);
Expand All @@ -25,7 +33,7 @@

&-header-label {
padding: var(--header-padding);
font-size: var(--bui-title-size-2);
font-size: var(--title-font-size);
}

&-header-icon-arrow {
Expand All @@ -39,7 +47,7 @@

&-content {
padding: var(--content-padding);
font-size: var(--bui-text-size-1);
font-size: var(--content-font-size);
transition: height 0.5s ease;
overflow: hidden;
}
Expand Down
12 changes: 7 additions & 5 deletions packages/bui-core/src/CollapsePanel/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,10 @@ export default () => {

### 样式变量

| 属性 | 说明 | 默认值 | 全局变量 |
| ----------------- | -------------- | ----------------------- | ------------------------------------ |
| --width | 宽度 | 100% | --bui-collapse-panel-width |
| --header-padding | 面板头部内边距 | var(--bui-spacing-lg) 0 | --bui-collapse-panel-header-padding |
| --content-padding | 面板主题内边距 | var(--bui-spacing-lg) 0 | --bui-collapse-panel-content-padding |
| 属性 | 说明 | 默认值 | 全局变量 |
| ------------------- | -------------- | ----------------------- | -------------------------------------- |
| --width | 宽度 | 100% | --bui-collapse-panel-width |
| --header-padding | 面板头部内边距 | var(--bui-spacing-lg) 0 | --bui-collapse-panel-header-padding |
| --content-padding | 面板主题内边距 | var(--bui-spacing-lg) 0 | --bui-collapse-panel-content-padding |
| --title-font-size | 面板标题字号 | var(--bui-title-size-3) | --bui-collapse-panel-content-font-size |
| --content-font-size | 面板内容字号 | var(--bui-text-size-1) | --bui-collapse-panel-content-font-size |

0 comments on commit b7fd330

Please sign in to comment.