Code Monkey home page Code Monkey logo

Comments (2)

crystalarcus avatar crystalarcus commented on August 17, 2024

@lukewalczak any thoughts on this ?

from react-native-paper.

macinjoke avatar macinjoke commented on August 17, 2024

I noticed this problem too. And I found this article https://material.io/blog/tone-based-surface-color-m3

Surface Container Lowest is a new role
Surface at elevation +1 becomes Surface Container Low
Surface at elevation +2 becomes Surface Container
Surface at elevation +3 becomes Surface Container High
Surface at elevation +4 and +5 are being deprecated, it is recommended to use Surface Container Highest by default as a replacement. As an alternative Surface Container High, or Surface Dim can be used depending on the specific use case.
Surface Variant becomes Surface Container Highest

So I set my theme like this:

/**
 * copy from Material Theme Builder
 * @see https://material-foundation.github.io/material-theme-builder/
 */
export const lightColors = {
  primary: '#7b5800',
  // ...
  surfaceContainerHighest: '#e9e1d9',
  surfaceContainerHigh: '#efe7de',
  surfaceContainer: '#f5ede4',
  surfaceContainerLow: '#fbf2e9',
  surfaceContainerLowest: '#ffffff',

  // manually added 
  elevation: {
    ...MD3LightTheme.colors.elevation,
    level1: '#fbf2e9', // surfaceContainerLow
    level2: '#f5ede4', // surfaceContainer
    level3: '#efe7de', // surfaceContainerHigh
    level4: '#e9e1d9', // surfaceContainerHighest
    level5: '#e9e1d9', // surfaceContainerHighest
  },
}

This has been confirmed to work correctly with the background color of the Card in elevated mode.
https://callstack.github.io/react-native-paper/docs/components/Card/#theme-colors

from react-native-paper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.