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_
variant Deprecated - Pick a theme variant based on the requested mode.
- to_
theme - Convert a
ThemeVariantinto a gpui-componentTheme.