Skip to content

Commit

Permalink
feat(atomic): add extra padding for first element
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmedini committed Jul 6, 2023
1 parent 6f6eb44 commit d1b3213
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ atomic-result-section-children {
@apply p-6;
}
}

:host(.firstInsightResultWithActionBar) {
.with-sections {
@apply pt-8;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,15 @@ export class AtomicInsightResult {
}

private get firstChildActionBar() {
return this.host.parentElement
?.querySelectorAll('atomic-insight-result')?.[0]
.shadowRoot?.querySelector('atomic-insight-result-action-bar');
return this.firstInsightResult?.shadowRoot?.querySelector(
'atomic-insight-result-action-bar'
);
}

private get firstInsightResult() {
return this.host.parentElement?.querySelectorAll(
'atomic-insight-result'
)?.[0];
}

public render() {
Expand All @@ -172,6 +178,7 @@ export class AtomicInsightResult {
}
if (this.resultActionBar && this.resultActions?.length) {
this.firstChildActionBar?.classList.add('firstActionBarElement');
this.firstInsightResult?.classList.add('firstInsightResultWithActionBar');
this.host.addEventListener('mouseover', this.handleMouseOver);
this.host.addEventListener('mouseout', this.handleMouseOut);
}
Expand Down

0 comments on commit d1b3213

Please sign in to comment.