clwind 0.1.0

TailwindCSS like utility for CLI
Documentation
  • Coverage
  • 68.35%
    54 out of 79 items documented44 out of 51 items with examples
  • Size
  • Source code size: 24.21 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.55 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • cataliniuga/clwind
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cataliniuga

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