|
|
@@ -0,0 +1,20 @@
|
|
|
+use termio::{StyledText, Termio};
|
|
|
+
|
|
|
+fn main() {
|
|
|
+ let mut termio = Termio::new();
|
|
|
+
|
|
|
+ // Parse CSS-like syntax from a string
|
|
|
+ let css = r#"
|
|
|
+ @element "header" {
|
|
|
+ color: red;
|
|
|
+ background: black;
|
|
|
+ decoration: bold;
|
|
|
+ padding: 1;
|
|
|
+ }
|
|
|
+ "#;
|
|
|
+
|
|
|
+ termio.parse(css).unwrap();
|
|
|
+
|
|
|
+ // Style text using the parsed styles
|
|
|
+ println!("{}", "This is a header".style("header", &termio));
|
|
|
+}
|