Skip to content

Overriding Surface elevation colors is a bit undocumented #4301

Open
@jimbofoo

Description

@jimbofoo

Current behaviour

When overriding the elevation level colors for a surface it's not obvious how to do that.
For example:

<Surface
       mode="flat"
       elevation={0}
       theme={{
         colors: {
           elevation: ['red', 'green', 'blue']
         }
       }}
     >
       <Text >Test</Text>
</Surface>

Does not work, it needs this undocumented construct:

<Surface
       mode="flat"
       elevation={0}
       theme={{
         colors: {
           elevation: { level0: 'red', level1: 'green', level2: 'blue' }
         }
       }}
     >
       <Text >Test</Text>
</Surface>

Expected behaviour

Surface elevation color overrides as an array or better documentation about the special construct.

Your Environment

software version
react-native-paper 5.12.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions