floating-ui-dom 0.6.0

Rust port of Floating UI. Floating UI for the web.
Documentation
1
2
3
4
5
6
7
8
9
use floating_ui_utils::Length;
use web_sys::Element;

pub fn get_client_length(element: &Element, length: Length) -> f64 {
    match length {
        Length::Width => element.client_width() as f64,
        Length::Height => element.client_height() as f64,
    }
}