sk-tree 0.4.0

Skathi's retained node tree and the renderer's host functions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! The used `color-scheme` of the controls Skathi draws.

use gpui::Window;

use crate::tree::Tree;
use crate::windows;

/// `Some(dark)` when the element's `color-scheme` names light or dark; `None` under `normal`, where
/// each control keeps its own default.
pub(crate) fn declared(t: &Tree, id: u32, window: &Window) -> Option<bool> {
    let vars = &t.node(id)?.computed.as_ref()?.vars;
    let env = windows::env_of(windows::key(window)).unwrap_or_else(crate::env);
    sk_css::color_scheme(vars, &env)
}