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

Correct usage of `dark` property in theme

Open traviswimer opened this issue 3 years ago • 6 comments

I am having trouble understanding the correct way to implement a dark theme based on the docs.

The issue is that there seems to be a conflict between using the dark property and using a DarkTheme object or I simply don't understand how it is meant to work.

My understanding is that the dark property is swapping the surface and primary colors and altering opacity in some components. The confusing part is that if you set dark: true in a DarkTheme object, you are actually setting it to a light theme.

  1. Is the dark property only intended to be used as a quick and lazy way to convert a light theme to a dark one?
  2. Should dark: true ever be used if you are creating a custom light and dark theme?

This isn't a bug. It's just a question or possibly a suggestion to improve the documentation. It doesn't really make sense to include a "minimal repro", but I think this issue is getting ignored since it has a needs repro label.

So, here's a completely useless expo snack containing absolutely nothing relevant: https://snack.expo.dev/20dQJ05RQ

traviswimer avatar Jan 06 '22 13:01 traviswimer

Couldn't find version numbers for the following packages in the issue:

  • react-native
  • react-native-paper
  • react-native-vector-icons

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

github-actions[bot] avatar Jan 06 '22 13:01 github-actions[bot]

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

github-actions[bot] avatar Jan 06 '22 13:01 github-actions[bot]

Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.

github-actions[bot] avatar Feb 06 '22 02:02 github-actions[bot]

Couldn't find version numbers for the following packages in the issue:

  • react-native
  • react-native-paper
  • react-native-vector-icons
  • expo

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

github-actions[bot] avatar Feb 06 '22 14:02 github-actions[bot]

Hello bot. Please remove the stale label. 😀

traviswimer avatar Feb 06 '22 15:02 traviswimer

Hello @traviswimer, I guess the role of dark property was a quick way to define whether component's background color is dark-ish, so then the color of the text or icon will be switched to the contrasting color, regardless of what the theme is.

Please check the following snack, where I tried to illustrate it: https://snack.expo.dev/qhgwZULoP

lukewalczak avatar Feb 06 '22 17:02 lukewalczak