Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/popular-wombats-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': minor
---

Added the `part="body"` attribute to the `post-accordion-item .accordion-body` shadowdom element, so it is possible to override the implemented styles.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { HEADING_LEVELS, HeadingLevel } from '@/types';
import { checkEmptyOrOneOf } from '@/utils';

/**
* @part accordion-item - The container element that wraps the entire accordion item.
* @part body - The container element that holds the accordion item's content.
* @slot header - Slot for placing custom content within the accordion item's header.
* @slot default - Slot for placing content within the accordion item's body.
*/
Expand Down Expand Up @@ -86,7 +88,7 @@ export class PostAccordionItem {
collapsed={this.collapsed}
ref={el => (this.collapsible = el)}
>
<div class="accordion-body">
<div class="accordion-body" part="body">
<slot />
</div>
</post-collapsible>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ Type: `Promise<boolean>`

## Shadow Parts

| Part | Description |
| ------------------ | ----------- |
| `"accordion-item"` | |
| Part | Description |
| ------------------ | -------------------------------------------------------------- |
| `"accordion-item"` | The container element that wraps the entire accordion item. |
| `"body"` | The container element that holds the accordion item's content. |


## Dependencies
Expand Down