microsoft / fluentui-react-native

A react-native component library that implements the Fluent Design System.

Home Page:https://developer.microsoft.com/fluentui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make default theme use platform-specific alias tokens

lyzhan7 opened this issue · comments

Platform

  • iOS
  • macOS
  • win32
  • windows
  • android

Describe the feature that you would like added

Current state of the default theme:

  • The defaultTheme was set up before all of the other platforms were fully supported, and was based on the web palette as a fallback (which currently windows in FURN also uses). It works like a web theme, which means that it has light/dark/hc as its modes.
  • Up until this PR, the default theme has been using web/windows tokens. After that change, on Android only, the default theme is actually using Android tokens.
  • iOS will likely also be following Android and will also be in a mixed state (default theme is getting created with iOS tokens)
  • One of the issues with how iOS/Android currently work, is that the default theme creation code assumes there is a light, dark, and high contrast mode version. iOS and android currently do not support light or dark mode, so as a workaround both currently return use light mode tokens to populate the default theme
  • So currently, how each platform's default-theme works is different

Whether the default theme should be using web/windows tokens or should be using platform specific tokens was brought up with the recent iOS color tokens work. We are thinking of changing the existing behavior so that the default theme is more specific to each platform. An engineering plan will need to be drawn up for this work, and we should ensure that the changes do not impact package size.

Some open questions to consider

  • Is it possible to not pull in the defaultTheme if a client provides a ThemeProvider

What component or utility would this be added to

No response

Have you discussed this feature with our team, and if so, who

No response

Additional context/screenshots

No response