diff --git a/src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.styles.ts b/src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.styles.ts index b60ce1c54c59e..99fa2abf84841 100644 --- a/src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.styles.ts +++ b/src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.styles.ts @@ -9,47 +9,63 @@ import { css } from '@emotion/react'; import { layoutVar, layoutLevels } from '@kbn/core-chrome-layout-constants'; -import { euiOverflowScroll, euiShadow } from '@elastic/eui'; +import { euiOverflowScroll, euiShadow, type UseEuiTheme } from '@elastic/eui'; import { getHighContrastBorder } from '@kbn/core-chrome-layout-utils'; +import type { ChromeStyle } from '@kbn/core-chrome-browser'; import type { EmotionFn } from '../types'; -const root: EmotionFn = (useEuiTheme) => - css` - grid-area: application; +const root = (chromeStyle: ChromeStyle = 'classic'): EmotionFn => { + const isProjectStyle = chromeStyle === 'project'; - height: calc(100% - ${layoutVar('application.marginBottom')}); - width: calc(100% - ${layoutVar('application.marginRight')}); - margin-bottom: ${layoutVar('application.marginBottom')}; - margin-right: ${layoutVar('application.marginRight')}; + return (useEuiTheme: UseEuiTheme) => { + return css` + grid-area: application; - z-index: ${layoutLevels.content}; + height: calc(100% - ${layoutVar('application.marginBottom')}); + width: calc(100% - ${layoutVar('application.marginRight')}); + margin-bottom: ${layoutVar('application.marginBottom')}; + margin-right: ${layoutVar('application.marginRight')}; - position: relative; - display: flex; - flex-direction: column; + z-index: ${layoutLevels.content}; - background-color: ${useEuiTheme.euiTheme.colors.backgroundBasePlain}; - border-radius: ${useEuiTheme.euiTheme.border.radius.medium}; - border: ${getHighContrastBorder(useEuiTheme)}; - ${euiShadow(useEuiTheme, 'xs', { border: 'none' })}; + position: relative; + display: flex; + flex-direction: column; - &:focus-visible { - border: 2px solid ${useEuiTheme.euiTheme.colors.textParagraph}; - } + // Only apply distinguished background styling for "project" chrome style + ${isProjectStyle && + css` + background-color: ${useEuiTheme.euiTheme.colors.backgroundBasePlain}; + border-radius: ${useEuiTheme.euiTheme.border.radius.medium}; + border: ${getHighContrastBorder(useEuiTheme)}; + ${euiShadow(useEuiTheme, 'xs', { border: 'none' })}; + `} + ${!isProjectStyle && + css` + background-color: transparent; + border-radius: 0; + border: none; + `} - // only restrict overflow scroll on screen (not print) to allow for full page printing - @media screen { - ${euiOverflowScroll(useEuiTheme, { direction: 'y' })}; - // reset the height back to respect the margin bottom - height: calc(100% - ${layoutVar('application.marginBottom')}); + &:focus-visible { + border: 2px solid ${useEuiTheme.euiTheme.colors.textParagraph}; + } - // Hide scrollbar - scrollbar-width: none; /* Firefox */ - &::-webkit-scrollbar { - display: none; /* Chrome, Safari, Edge */ + // only restrict overflow scroll on screen (not print) to allow for full page printing + @media screen { + ${euiOverflowScroll(useEuiTheme, { direction: 'y' })}; + // reset the height back to respect the margin bottom + height: calc(100% - ${layoutVar('application.marginBottom')}); + + // Hide scrollbar + scrollbar-width: none; /* Firefox */ + &::-webkit-scrollbar { + display: none; /* Chrome, Safari, Edge */ + } } - } - `; + `; + }; +}; const content: EmotionFn = () => css` display: flex; diff --git a/src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.tsx b/src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.tsx index ef1a2ba7f2fff..0d171b1b50904 100644 --- a/src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.tsx +++ b/src/core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.tsx @@ -13,6 +13,7 @@ import React from 'react'; import { APP_MAIN_SCROLL_CONTAINER_ID } from '@kbn/core-chrome-layout-constants'; import { styles } from './layout_application.styles'; +import { useLayoutConfig } from '../layout_config_context'; /** * The application slot wrapper @@ -29,9 +30,11 @@ export const LayoutApplication = ({ topBar?: ReactNode; bottomBar?: ReactNode; }) => { + const { chromeStyle } = useLayoutConfig(); + return (