pub fn from_system() -> Result<SystemTheme>Expand description
Read the current system theme, auto-detecting the platform and desktop environment.
Runs the full OS-first pipeline: OS reader -> platform preset merge ->
resolve -> validate -> SystemTheme with both light and dark
ResolvedTheme variants.
§Platform Behavior
- macOS: Calls
from_macos()when themacosfeature is enabled. Reads both light and dark variants via NSAppearance, merges withmacos-sonomapreset. - Linux (KDE): Calls
from_kde()whenXDG_CURRENT_DESKTOPcontains “KDE” and thekdefeature is enabled, merges withkde-breezepreset. - Linux (other): Uses the
adwaitapreset. For live GNOME portal data, usefrom_system_async()(requiresportal-tokioorportal-async-iofeature). - Windows: Calls
from_windows()when thewindowsfeature is enabled, merges withwindows-11preset. - Other platforms: Returns
Error::Unsupported.
§Errors
Error::Unsupportedif the platform has no reader or the required feature is not enabled.Error::Unavailableif the platform reader cannot access theme data.