callstack / callstack/react-native-paper

Surface: first-class semantic container color API independent of elevation

オープン
#5,119 コメント 0 件 リアクション 0 件 担当者 1 名 @hristototov が担当を希望しています GitHub で見る
feature request v6
主要言語
TypeScript
スター
14.5k
フォーク
2.2k
平均マージ
5日 23時間
マージ済み PR(30日)
12

説明

**Is your feature request related to a problem? Please describe.**

`Surface` derives its background color directly from the numeric `elevation` prop (`theme.colors.elevation.levelN`), including in `mode="flat"` and during animated elevation changes. A component cannot express "this container is `surfaceContainerLow`, and elevation only controls the shadow". The only escape hatch is passing a raw color via `backgroundColor`, which loses the semantic intent and doesn't track the theme role. As components are modernized to MD3 (e.g. Menu in #5037, which the spec fills with `surfaceContainer`), each one has to invent its own workaround.

**Describe the solution you'd like**

A `container` prop on `Surface` accepting a semantic surface-family color role (`surface`, `surfaceDim`, `surfaceBright`, `surfaceVariant`, `surfaceContainerLowest`–`surfaceContainerHighest`, `inverseSurface`), resolved from the theme:

```tsx

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。