clwind

Crates.ioclwind
lib.rsclwind
version0.1.0
sourcesrc
created_at2024-07-13 21:42:49.291997
updated_at2024-07-13 21:42:49.291997
descriptionTailwindCSS like utility for CLI
homepage
repositoryhttps://github.com/CatalinIuga/clwind/
max_upload_size
id1302625
size24,553
Catalin (CatalinIuga)

documentation

README

clwind - TailwindCSS-ish API for you CLI text

ANSII color codes are a pain to remember, and just like plain CSS, it can take more time to write than it should. This is a simple API that allows you to add colors and styles to your CLI text with a TailwindCSS-like syntax.

Installation

Get the module from

cargo add clwind

Usage

use clwind::{clw, Color::Hex};

fn main() {
    let ansii_formated = clw("Hello, World!")
        .bg_bright_red()
        .text(Hex(0xf2f2f2))
        .font_bold()
        .font_underline();

    println!("{}", ansii_formated);
}

Features

Colors

  • Variants: black, red, green, yellow, blue, magenta, cyan, white; and the bright_ prefixes for each of them.
  • Hex: Hex(0xf2f2f2)
  • RGB: RGB(255, 255, 255)
  • 256: Color256(255)

Styles

  • bold
  • dim
  • italic
  • underline
  • blink
  • reverse
  • hidden
  • strikethrough

License

MIT

Commit count: 0

cargo fmt