Skip to content

Commit

Permalink
feat(accordion): update icon size & disabled + open state
Browse files Browse the repository at this point in the history
  • Loading branch information
Leotheluck authored and dpellier committed Jul 29, 2024
1 parent 32369ad commit 99b16bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
opacity: .5;
cursor: not-allowed;

&:hover,
&.ods-accordion__wrapper--is-open {
&:hover {
border-color: transparent;
}

&.ods-accordion__wrapper--is-open,
&.ods-accordion__wrapper--is-open :hover {
border-color: var(--ods-color-primary-500);
}
}

&__summary {
Expand Down Expand Up @@ -60,7 +63,7 @@

&__icon {
color: var(--ods-color-primary-500);
font-size: 0.65rem;
font-size: 0.875rem;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class OdsAccordion {

@Watch('isOpen')
onOpenChange(): void {
if (this.isOpen && !this.isDisabled) {
if (this.isOpen) {
this.detailsElement?.setAttribute('open', '');
} else {
this.detailsElement?.removeAttribute('open');
Expand Down Expand Up @@ -90,7 +90,7 @@ export class OdsAccordion {
</div>
<ods-icon
class="ods-accordion__wrapper__summary__icon"
name={ this.isOpen && !this.isDisabled ? ODS_ICON_NAME.chevronUp : ODS_ICON_NAME.chevronDown }
name={ this.isOpen ? ODS_ICON_NAME.chevronUp : ODS_ICON_NAME.chevronDown }
></ods-icon>
</summary>
<div
Expand Down
2 changes: 2 additions & 0 deletions packages/ods/src/components/accordion/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</ods-text>
</ods-accordion>

<p>Disabled & open</p>
<ods-accordion is-disabled is-open>
<ods-text class="label" slot="summary" preset="heading-6">Hello, world!</ods-text>
<ods-text preset="span">
Expand Down

0 comments on commit 99b16bf

Please sign in to comment.