use styrust::*;
use styrust::Padding as P;

//wrapper type text display
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let (pt, pr, pb, pl) = (
        P::px(8.0)?,
        P::px(16.0)?,
        P::px(8.0)?,
        P::px(16.0)?,
    );
    let f_color = Color::rgb(224, 224, 224);
    let bg_color = BackgroundColor::rgb(155, 155, 155);
    
    let width = Width::px(120.0)?;
    let height = Height::px(40.0)?;
    let margin = Margin::px(5.0)?;

    let style = css_style!(
        selector!(unsafe{.btn, #btn_a}h1{
            text!(
                size(unsafe{ 16px }), color(f_color),
            );
            bg! {
                color(bg_color), h(height),// w(width),
                p(pt, pr, pb, pl),
            }
            layout![
                m(margin) 
            ];
            unsafe { 
                display: flex; 
                justify-content: center; 
                align-items: center; 
            }
            
        });
        
        width: width;
    );
    println!("{}", style);
    Ok(())
}