Function relm4::set_global_css

source ·
pub fn set_global_css(style_data: &str)
Expand description

Sets a custom global stylesheet.

Panics

This function panics if RelmApp::new wasn’t called before or this function is not called on the thread that also called RelmApp::new.

Examples found in repository?
src/lib.rs (line 169)
166
167
168
169
170
171
172
173
174
175
pub fn set_global_css_from_file<P: AsRef<std::path::Path>>(path: P) {
    match std::fs::read_to_string(path) {
        Ok(bytes) => {
            set_global_css(&bytes);
        }
        Err(err) => {
            tracing::error!("Couldn't load global CSS from file: {}", err);
        }
    }
}