Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/eui/changelogs/upcoming/8519.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**Bug fixes**

- Fixed a visual issue of overlapping borders for layered `EuiPanel`s

29 changes: 29 additions & 0 deletions packages/eui/src/components/panel/panel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';

import {
Expand Down Expand Up @@ -45,3 +46,31 @@ export const Playground: Story = {
children: 'Panel content',
},
};

/* Verifying that borders are applied in correct order */
export const OverlappingPanels: Story = {
tags: ['vrt-only'],
globals: { colorMode: 'dark' },
args: {
children: 'Panel content',
},
render: function Render(args: EuiPanelProps) {
return (
<>
<EuiPanel {...args} />
<EuiPanel
{...args}
css={({ euiTheme }) => ({
top: `-${euiTheme.size.m}`,
})}
/>
<EuiPanel
{...args}
css={({ euiTheme }) => ({
top: `-${euiTheme.size.l}`,
})}
/>
</>
);
},
};
4 changes: 2 additions & 2 deletions packages/eui/src/components/panel/panel.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ export const euiPanelBorderStyles = (
/* Using a pseudo element for the border instead of floating border only
because the transparent border might otherwise be visible with arbitrary
full-width/height content in light mode. */
&::before {
&::after {
content: '';
position: absolute;
/* ensure to keep on top of flush content */
z-index: 1;
z-index: 0;
inset: 0;
border: ${euiTheme.border.width.thin} solid
${
Expand Down
6 changes: 3 additions & 3 deletions packages/eui/src/components/toast/toast.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const euiToastStyles = (euiThemeContext: UseEuiTheme) => {
color: string,
width?: CSSProperties['borderWidth']
) => `
&:after {
&:before {
content: '';
position: absolute;
/* ensure highlight border is on top of panel border */
Expand Down Expand Up @@ -80,7 +80,7 @@ export const euiToastStyles = (euiThemeContext: UseEuiTheme) => {
preferred: `
${highlightStyles(color, borderWidth)}

&::after {
&::before {
${logicalCSS(
'width',
`calc(100% + ${mathWithUnits(
Expand All @@ -96,7 +96,7 @@ export const euiToastStyles = (euiThemeContext: UseEuiTheme) => {
forced: `
overflow: hidden;

&::after {
&::before {
content: '';
position: absolute;
${logicalCSS('top', 0)}
Expand Down