Skip to content

Commit 11d4754

Browse files
committed
refactor: updates border implementation on panels
- prevents transparent borders showing on colored full-width content, e.g. for EuiSplitPanel
1 parent b9c74a0 commit 11d4754

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

packages/eui/src/components/panel/panel.styles.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@ import {
1818
export const euiPanelStyles = (euiThemeContext: UseEuiTheme) => {
1919
const { euiTheme } = euiThemeContext;
2020

21+
const borderStyle = `
22+
position: relative;
23+
24+
/* Using a pseudo element for the border instead of floating border only
25+
because the transparent border might otherwise be visible with arbitrary
26+
full-width/height content in light mode. */
27+
::before {
28+
content: '';
29+
position: absolute;
30+
inset: 0;
31+
border: ${euiTheme.border.width.thin} solid
32+
${euiTheme.colors.borderBaseFloating};
33+
border-radius: inherit;
34+
pointer-events: none;
35+
}
36+
`;
37+
2138
return {
2239
// Base
2340
euiPanel: css`
@@ -30,8 +47,8 @@ export const euiPanelStyles = (euiThemeContext: UseEuiTheme) => {
3047

3148
hasShadow: css`
3249
${euiShadow(euiThemeContext, 'm')}
33-
border: ${euiTheme.border.width.thin} solid ${euiTheme.colors
34-
.borderBaseFloating};
50+
51+
${borderStyle}
3552
`,
3653

3754
hasBorder: css`

0 commit comments

Comments
 (0)