Skip to content

Commit 6ca64cd

Browse files
authored
fix: vertical centering for h2 headers without description in expandable sections (#3993)
1 parent 0c24161 commit 6ca64cd

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/expandable-section/expandable-section-header.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,12 @@ export const ExpandableSectionHeader = ({
320320
}
321321
return (
322322
<ExpandableHeaderTextWrapper
323-
className={clsx(className, wrapperClassName, expanded && styles.expanded)}
323+
className={clsx(
324+
className,
325+
wrapperClassName,
326+
expanded && styles.expanded,
327+
!expanded && (!headerActions || headerDescription) && styles['wrapper-not-expanded-without-actions']
328+
)}
324329
descriptionId={descriptionId}
325330
headerDescription={headerDescription}
326331
headerCounter={headerCounter}

src/expandable-section/styles.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ $icon-total-space-medium: calc(#{$icon-width-medium} + #{$icon-margin-left} + #{
138138
// Equal top and bottom padding so standalone header has vertical symmetry.
139139
padding-block-end: awsui.$space-container-header-top;
140140
}
141+
142+
&.wrapper-not-expanded-without-actions {
143+
padding-block-end: calc(#{awsui.$space-container-header-top} + #{awsui.$space-scaled-xxs});
144+
}
145+
141146
&.header-deprecated {
142147
padding-inline-start: container.$header-padding-horizontal;
143148
}

0 commit comments

Comments
 (0)