advanced/
advanced.rs

1use termio::*;
2
3fn main() {
4    let mut tcss = Termio::new();
5    
6    let tcss_content = r#"
7        @element "card" {
8            color: white;
9            background: i-black;
10            decoration: bold;
11            border: rounded i-blue;
12            padding: 1;
13        }
14
15        @element "title" {
16            color: i-blue;
17            decoration: bold underline;
18        }
19
20        @element "button" {
21            color: black;
22            background: i-green;
23            decoration: bold;
24            border: rounded i-green;
25        }
26
27        @element "error" {
28            color: white;
29            background: i-red;
30            decoration: bold;
31            border: solid i-red;
32        }
33    "#;
34
35    tcss.parse(tcss_content).unwrap();
36
37    // Create a card with a header and buttons
38    println!("{}", "User Profile".style("title", &tcss));
39    println!("{}", "Name: John Doe\nEmail: john@example.com".style("card", &tcss));
40    println!("{}", "Edit Profile".style("button", &tcss));
41    println!("{}", "Delete Account".style("button", &tcss));
42    println!("{}", "Failed to connect to server".style("error", &tcss));
43}