react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Overriding Surface elevation colors is a bit undocumented

Open jimbofoo opened this issue 2 years ago • 0 comments

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

jimbofoo avatar Jan 29 '24 18:01 jimbofoo