kimono
A simple terminal css engine inspired by lipgloss for truecolor 24-bit terminals.
cargo add kimono
Example
Unicode text can be styled, padded, and bordered.
use *;
const STYLE: Style = new
.padding_top
.padding_left
.padding_right
.padding_bottom
.border
.border_style
.border_color
.border_background
.color
.background;
Text can be constrained to height and width.
use kimono::*;
const STYLE: Style = Style::new()
.padding(1)
.color(0xfffd7c)
.width(8)
.background(0x956471);
fn main() {
print!("{}{}", ClearScreen, CursorMove::XY(10, 3));
STYLE.render(text);
print!("{}", CursorMove::XY(-10, 3));
println!("{:?}", STYLE.measure("abcdefghijklmno"));
}
Text can be measured.
(8, 5)
use kimono::*;
const STYLE: Style = Style::new()
.padding(1)
.color(0xfffd7c)
.width(8)
.background(0x956471);
fn main() {
println!("{:?}", STYLE.measure(abcdefghijklmno));
}
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in kimono by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.