Skip to content

Commit

Permalink
fix: Make closed expandable section header padding symmetrical
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuelz committed Aug 8, 2023
1 parent fc92170 commit dee94f4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/container/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
&.with-paddings {
padding: shared.$header-padding;
&.header-variant-cards {
padding: awsui.$space-scaled-s awsui.$space-container-horizontal;
padding: awsui.$space-container-header-top awsui.$space-container-horizontal;
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/expandable-section/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ $icon-total-space-medium: calc(#{$icon-width-medium} + #{$icon-margin-left} + #{
padding-bottom: awsui.$space-container-header-bottom;
padding-right: container.$header-padding-horizontal;

&:not(.wrapper-expanded) {
padding-bottom: awsui.$space-container-header-top;
}
&.header-deprecated {
padding-left: container.$header-padding-horizontal;
}
Expand Down
2 changes: 1 addition & 1 deletion src/header/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function InternalHeader({
styles.title,
styles[`title-variant-${variantOverride}`],
isRefresh && styles.refresh,
description && [styles[`root-has-description`]]
actions && [styles[`has-actions`]]
)}
>
<HeadingTag className={clsx(styles.heading, styles[`heading-variant-${variantOverride}`])}>
Expand Down
19 changes: 10 additions & 9 deletions src/header/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
&.refresh {
display: flex;
flex-direction: column;
justify-content: center;
// Can't use justify-content: center because it won't align with configurable dashboard handle icon
}

Expand Down Expand Up @@ -108,21 +109,21 @@
font-size: awsui.$font-heading-xl-size;
// Use padding rather than center align so that all headers of the same size start at the same height in the container,
// whether there are buttons present or not; otherwise configurable dashboard handles are misaligned.
&.refresh {
padding-top: calc((#{awsui.$size-vertical-input} - #{awsui.$font-heading-xl-line-height}) / 2);
}
// &.refresh.has-actions {
// padding-top: calc((#{awsui.$size-vertical-input} - #{awsui.$font-heading-xl-line-height}) / 2);
// }
}
&-variant-h2 {
font-size: awsui.$font-heading-l-size;
&.refresh {
padding-top: calc((#{awsui.$size-vertical-input} - #{awsui.$font-heading-l-line-height}) / 2);
}
// &.refresh.has-actions {
// padding-top: calc((#{awsui.$size-vertical-input} - #{awsui.$font-heading-l-line-height}) / 2);
// }
}
&-variant-h3 {
font-size: awsui.$font-heading-m-size;
&.refresh {
padding-top: calc((#{awsui.$size-vertical-input} - #{awsui.$font-heading-m-line-height}) / 2);
}
// &.refresh.has-actions {
// padding-top: calc((#{awsui.$size-vertical-input} - #{awsui.$font-heading-m-line-height}) / 2);
// }
}
&-variant-h2:not(.refresh),
&-variant-h3:not(.refresh) {
Expand Down

0 comments on commit dee94f4

Please sign in to comment.