Skip to content

Commit

Permalink
feat(CCollapseBtn): remove inheritBtnClass config option, closes #155
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

CCollapseBtn doesn’t inherit CBtn `class` config anymore.
  • Loading branch information
LeBenLeBen committed Mar 2, 2022
1 parent 926182e commit bf84274
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/chusho/lib/components/CCollapse/CCollapseBtn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default defineComponent({
...this.$props,
active: isActive,
}),
bare: this.config?.inheritBtnClass === false,
bare: true,
active: isActive,
};

Expand Down
4 changes: 1 addition & 3 deletions packages/chusho/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ interface ComponentsOptions {
collapse?: ComponentCommonOptions & {
transition?: BaseTransitionProps;
};
collapseBtn?: ComponentCommonOptions & {
inheritBtnClass: boolean;
};
collapseBtn?: ComponentCommonOptions;
collapseContent?: ComponentCommonOptions & {
transition?: BaseTransitionProps;
};
Expand Down
1 change: 0 additions & 1 deletion packages/chusho/src/chusho.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default {
},

collapseBtn: {
inheritBtnClass: false,
class({ active }) {
return [
'py-2 px-4 border-2 border-gray-400 rounded',
Expand Down
9 changes: 0 additions & 9 deletions packages/docs/guide/components/collapse.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ class({ active }) {
}
```

### CCollapseBtn

#### inheritBtnClass

Since the CCollapseBtn is a CBtn in the background, it will inherits its `class` config option. To disable this behavior, set this option to `false`.

- **type:** `Boolean`
- **default:** `true`

### CCollapseContent

#### transition
Expand Down

0 comments on commit bf84274

Please sign in to comment.