resolveNativeTheme (native/tokens.ts)

tutti · packages/ui/system/src/native/tokens.ts · typescript · Apache-2.0
ui, tag:embed-classified

Resolves a neutral theme object for React Native from mode.

// Source: https://github.com/tutti-os/tutti | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import {
  nativeThemeDimensions,
  nativeThemes,
  type NativeThemeMode,
  type NativeThemePalette
} from "./generated-tokens";

export { nativeThemeDimensions, nativeThemes };
export type { NativeThemeMode, NativeThemePalette };

/**
 * Resolves a renderer-neutral semantic theme for React Native.
 */
export function resolveNativeTheme(mode: NativeThemeMode) {
  const palette = nativeThemes[mode];

  return {
    control: nativeThemeDimensions.control,
    color: {
      accent: palette.accent,
      accentPressed: palette.accentPressed,
      background: palette.background,
      border:

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key