/pim

pim is a lightweight converter for CSS units

Primary LanguageRustMIT LicenseMIT

pim

a lightweight converter for CSS units

Rust License


Installation

Build from Source

  1. Clone the repository:

    git clone https://github.com/airRnot1106/pim.git
    cd pim
  2. Build the binary:

    cargo build --release
  3. Run the tool:

    ./target/release/pim --help

Using Nix

If you have Nix installed:

nix run . -- --help

Usage

Basic Usage

To convert 24px to other unit:

pim 24 px

Output:

Input: 24px

px: 24px
pt: 18pt
em: 1.5em
rem: 1.5rem

Custom Root Font Size

Specify a custom root font size using the -r option:

pim 24 px -r 10

Output:

Input: 24px

px: 24px
pt: 18pt
em: 2.4em
rem: 2.4rem

Tests

Run all tests:

cargo test

License

pim is licensed under the MIT License.