Skip to content

Commit

Permalink
fix: address review
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioCastigliano committed Aug 14, 2024
1 parent 7506040 commit c010399
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/elements/container/container/container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
@include sbb.box-sizing;

:host {
--sbb-image-object-position: bottom;

display: block;
}

Expand Down Expand Up @@ -51,6 +49,9 @@
}

::slotted([slot='image']) {
--sbb-image-border-radius: 0;
--sbb-image-object-position: end;

position: absolute;
inset: 0;
z-index: -1;
Expand Down
15 changes: 2 additions & 13 deletions src/elements/container/container/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
import { customElement, property } from 'lit/decorators.js';

import { slotState } from '../../core/decorators.js';
import { SbbHydrationMixin } from '../../core/mixins.js';
import type { SbbImageElement } from '../../image.js';

import style from './container.scss?lit&inline';

Expand All @@ -22,7 +20,7 @@ import style from './container.scss?lit&inline';
*/
@customElement('sbb-container')
@slotState()
export class SbbContainerElement extends SbbHydrationMixin(LitElement) {
export class SbbContainerElement extends LitElement {
public static override styles: CSSResultGroup = style;

/** Whether the container is expanded. */
Expand All @@ -43,19 +41,10 @@ export class SbbContainerElement extends SbbHydrationMixin(LitElement) {
}
}

private _imageSlotChanged(): void {
const image: SbbImageElement = this.querySelector('sbb-image[slot="image"]') as SbbImageElement;
if (!image) {
return;
}

image.borderRadius = 'none';
}

protected override render(): TemplateResult {
return html`
<div class="sbb-container">
<slot name="image" @slotchange=${() => this._imageSlotChanged()}></slot>
<slot name="image"></slot>
<slot></slot>
</div>
<slot name="sticky-bar"></slot>
Expand Down

0 comments on commit c010399

Please sign in to comment.