Repository navigation
fix(menu, banner)!: use surfaceContainer roles for background - #5121
hristototov wants to merge 10 commits into
Conversation
…into hristototov/surface-semantic-container-color
|
Review by Claude iOSBanner text is unreadable with the custom theme in the Banner example. (via Claude, verify if it makes sense)
What happens: the text turns near white ( What should happen: the banner shows the dark tertiary background with light text, like on Surface example: role labels break mid-word and two tiles are invisible. (via Claude, verify if it makes sense)
What happens: What should happen: each label fits on its own line and each tile is visible against the screen background, for example with a border or AndroidBanner text is unreadable with the custom theme in the Banner example. (via Claude, verify if it makes sense) Same steps and cause as on iOS. With the dynamic theme, Banner and Menu change color compared to
What happens: the background now uses the wallpaper based What should happen: the migration guide says that the color changes when you use the dynamic themes on Android. WebBanner text is unreadable with the custom theme in the Banner example. (via Claude, verify if it makes sense) Same steps and cause as on iOS. (via Claude, verify if it makes sense) |
|
Review by Claude iOSSurface example, dark theme: the
What happens: in What should happen: every tile is visible in light and dark theme. A hairline AndroidSurface example, dark theme: the Same steps and cause as on iOS. WebSurface example, dark theme: the Same steps and cause as on iOS. (via Claude, verify if it makes sense) |
satya164
left a comment
There was a problem hiding this comment.
Review by Claude
docs/6.x/docs/guides/theming.mdx(line 109) still names menus as an example of surfaces tinted bytheme.colors.elevation. With this PR, Menu and Banner take their background fromsurfaceContainerandsurfaceContainerLow, so a reader who changeselevation.level2to restyle menus sees no effect. Drop "or menus" there, or add that Menu and Banner use thesurfaceContainer*roles. (via Claude, verify if it makes sense)
…into hristototov/surface-semantic-container-color
Updated |
|
Per D6 in #5150, Surface keeps its current API in 6.0 (new API can come in a minor), so could you trim this to the dynamic theme fix?
Once trimmed, it lands first in the Menu chain, before #5122, #5051 and #5073. |
…emantic-container-color # Conflicts: # src/components/__tests__/Banner.test.tsx # src/index.tsx
BREAKING CHANGE: Menu and Banner backgrounds no longer follow `elevation`. Menu uses `theme.colors.surfaceContainer` and Banner `theme.colors.surfaceContainerLow`; customize those roles or pass `backgroundColor` instead of `theme.colors.elevation.level2` and `level1`.
Done. The PR now has only the dynamic theme fix:
I also added an optional |
…emantic-container-color # Conflicts: # src/components/__tests__/Banner.test.tsx
jacekAtCK
left a comment
There was a problem hiding this comment.
looks good from the code side :) I've posted some comments below - mostly docs after the merge with main and one test. Nothing blocking












Motivation
Menu and Banner take their background from
theme.colors.elevation, which the dynamic themes don't override. On Android 14+ withDynamicLightThemeandDynamicDarkThemethey keep the static tint instead of the system surface colors.Menu now uses
surfaceContainerand BannersurfaceContainerLow, passed throughSurface's existingbackgroundColor.elevationonly controls the shadow. WithLightThemeandDarkThemethey look the same. Breaking for apps that customizedelevation.level1orelevation.level2to style Banner or Menu; the migration guide covers it.Related issue
Part of #5119
Screenshots / Videos
light-mode.mov
dark-mode.mov
Test plan