basic_style/basic_style.rs
1use mew_css::style;
2use mew_css::values::{Color, Size, Display};
3
4fn main() {
5 // Create a CSS style using the mew library
6 let css = style()
7 .color(Color::Blue)
8 .background_color(Color::Rgb(240, 240, 240))
9 .font_size(Size::Px(18))
10 .display(Display::Block)
11 .apply();
12
13 println!("Generated CSS: {}", css);
14
15 // Verify the output
16 let expected = "color: blue; background-color: rgb(240, 240, 240); font-size: 18px; display: block;";
17 assert_eq!(css, expected);
18
19 println!("Example completed successfully!");
20}