Skip to main content

Crate native_theme_gpui

Crate native_theme_gpui 

Source
Expand description

gpui toolkit connector for native-theme.

Maps native_theme::NativeTheme data to gpui-component’s theming system.

§Overview

This crate provides a thin mapping layer that converts native-theme’s platform-agnostic color, font, and geometry data into gpui-component’s Theme type. No intermediate types are introduced – the mapping goes directly from ThemeVariant fields to gpui-component types.

§Usage

use native_theme::NativeTheme;
use native_theme_gpui::to_theme;

let nt = NativeTheme::preset("default").unwrap();
let variant = nt.pick_variant(false).unwrap();
let theme = to_theme(variant, "Default", false);

Modules§

colors
ThemeColors -> gpui_component::theme::ThemeColor mapping (108 fields).
config
ThemeFonts/ThemeGeometry -> gpui_component::theme::ThemeConfig mapping.
derive
Shade derivation helpers for hover/active states.
icons
Icon conversion functions for the gpui connector.

Functions§

pick_variantDeprecated
Pick a theme variant based on the requested mode.
to_theme
Convert a ThemeVariant into a gpui-component Theme.