Skip to content

Commit

Permalink
fix: improve data attribute usage
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioCastigliano committed Jul 19, 2024
1 parent bd1f93b commit 84273b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ export class SbbFlipCardSummaryElement extends LitElement {
super.willUpdate(_changedProperties);

if (_changedProperties.has('imageAlignment')) {
this.closest?.('sbb-flip-card')?.toggleAttribute(
'data-image-after',
this.imageAlignment === 'after',
);
this.closest?.('sbb-flip-card')?.setAttribute('data-image-alignment', this.imageAlignment);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ snapshots["A11y tree Chrome"] =
/* end snapshot A11y tree Chrome */

snapshots["sbb-flip-card DOM"] =
`<sbb-flip-card data-image-after="">
`<sbb-flip-card data-image-alignment="after">
<sbb-flip-card-summary
image-alignment="after"
slot="summary"
Expand Down
2 changes: 1 addition & 1 deletion src/elements/flip-card/flip-card/flip-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}
}

:host([data-image-after]) {
:host([data-image-alignment='after']) {
@include sbb.mq($from: small, $to: medium) {
--sbb-flip-card-min-height: #{sbb.px-to-rem-build(240)};
}
Expand Down

0 comments on commit 84273b7

Please sign in to comment.