Make application layout background color conditional#248543
Make application layout background color conditional#248543ryankeairns merged 6 commits intomainfrom
Conversation
|
|
||
| const layoutConfigs: { classic: ChromeLayoutConfig; project: ChromeLayoutConfig } = { | ||
| classic: { | ||
| chromeStyle: 'classic', |
There was a problem hiding this comment.
Without this change, each component that needed to know the chrome style would have to:
- Get access to the chrome service somehow
- Subscribe to chromeStyle$
- Handle the observable subscription lifecycle
Now it's just a one-liner hook call. So if other layout slots (header, navigation, sidebar, footer, etc.) or any nested components need style variations between classic and project mode in the future, the plumbing is already in place.
const { chromeStyle } = useLayoutConfig();
// Then use it for conditional styling
const isProjectStyle = chromeStyle === 'project';
- Add ChromeStyle type ('classic' | 'project') to LayoutConfig
- Pass chromeStyle through layout config context
- Make background, border-radius, border, and shadow conditional
- Classic mode: transparent background, no styling
- Project mode: distinguished background with rounded corners and shadow
Similar pattern to Discover sidebar (discover_sidebar_responsive.tsx)
4f75a95 to
a6c062b
Compare
...ackages/chrome/layout/core-chrome-layout-components/application/layout_application.styles.ts
Show resolved
Hide resolved
...core/packages/chrome/layout/core-chrome-layout-components/application/layout_application.tsx
Outdated
Show resolved
Hide resolved
edded7b to
3fffbe4
Compare
- Return EmotionFn type to leverage Emotion's automatic theme injection - Remove explicit useEuiTheme hook call from LayoutApplication component - UseEuiTheme type now inferred from EmotionFn
8cbc9f2 to
4e076cc
Compare
| >; | ||
| > & { | ||
| chromeStyle?: ChromeStyle; | ||
| }; |
Dosant
left a comment
There was a problem hiding this comment.
didn't test, but layout config change 👍
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Page load bundle
History
|
## Summary
### Issue
The app workspace was recently changed to `plain` color but was not
intended to affect Classic mode. This PR makes the background color
conditional based upon ChromeStyle as was the initial intention.
### Changes
- Add ChromeStyle type ('classic' | 'project') to LayoutConfig
- Pass chromeStyle through layout config context
- Make background, border-radius, border, and shadow conditional
- Classic mode: transparent background, no styling
- Project mode: distinguished background with rounded corners and shadow
Similar pattern to Discover sidebar
[fix](elastic#248024)
(discover_sidebar_responsive.tsx)
### Before and After
_Before; green shade to highlight the issue_
<img width="2500" height="1754" alt="CleanShot 2026-01-09 at 11 15
01@2x"
src="https://github.com/user-attachments/assets/462416c6-7401-4fa1-84e4-e289807e1dd8"
/>
_After; light shade returned in Classic mode_
<img width="2648" height="1274" alt="CleanShot 2026-01-09 at 11 25
41@2x"
src="https://github.com/user-attachments/assets/b53c27e3-de1a-42fd-b748-0d850f6c7566"
/>
### Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
### Identify risks
Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.
- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Issue
The app workspace was recently changed to
plaincolor but was not intended to affect Classic mode. This PR makes the background color conditional based upon ChromeStyle as was the initial intention.Changes
Similar pattern to Discover sidebar fix (discover_sidebar_responsive.tsx)
Before and After
Before; green shade to highlight the issue

After; light shade returned in Classic mode

Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.Identify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.