Skip to content

Commit

Permalink
[PR feedback] Revert euiYScroll change
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Sep 5, 2023
1 parent 72b509a commit 4f08b9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,19 @@ export const euiCollapsibleNavBetaStyles = (euiThemeContext: UseEuiTheme) => {
// page load by setting the CSS var fallback to the height of a single header
const defaultHeaderHeight = euiHeaderVariables(euiThemeContext).height;
const fixedHeaderOffset = `var(--euiFixedHeadersOffset, ${defaultHeaderHeight})`;
const height = `calc(100% - ${fixedHeaderOffset})`;

return {
euiCollapsibleNavBeta: css`
/* Fixed header affordance */
${logicalCSS('top', fixedHeaderOffset)}
${logicalCSS('height', `calc(100% - ${fixedHeaderOffset})`)}
/* Set the height & allow the nav to scroll, in case consumers don't use EuiFlyoutBody/EuiFyoutFooter */
${euiYScroll(euiThemeContext, { height })}
/* This extra padding is needed for EuiPopovers to have enough
space to render with the right anchorPosition */
${logicalCSS('padding-bottom', euiTheme.size.xs)}
/* Allow the nav to scroll, in case consumers don't use EuiFlyoutBody/EuiFyoutFooter
Height is already set by header affordance above */
${euiYScroll(euiThemeContext, { height: false })}
/* In case things get really dire responsively, ensure the footer doesn't overtake the body */
.euiFlyoutBody {
${logicalCSS('min-height', '50%')}
Expand Down
4 changes: 2 additions & 2 deletions src/global_styling/mixins/_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ const euiOverflowShadowStyles = (
* Others like Safari, won't show anything at all.
*/
interface _EuiYScroll {
height?: CSSProperties['height'] | false;
height?: CSSProperties['height'];
}
export const euiYScroll = (
euiTheme: UseEuiTheme,
{ height }: _EuiYScroll = {}
) => `
${euiScrollBarStyles(euiTheme)}
${height !== false ? logicalCSS('height', height || '100%') : ''}
${logicalCSS('height', height || '100%')}
${logicalCSSWithFallback('overflow-y', 'auto')}
${logicalCSSWithFallback('overflow-x', 'hidden')}
&:focus {
Expand Down

0 comments on commit 4f08b9a

Please sign in to comment.