Skip to content

MayorMonty/css

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

css

An easy-to-follow CSS parser and minifier written in Rust, with no dependancies! This module takes a CSS file as input, will tokenize and parse the source code for parse errors, and output a parallel .min.css file with a minified source graph.

Run using cargo:

cargo run file.css

Alternatively, to produce a static executable, use cargo build:

cargo build --release

Consider the following main.css file:

.App-Header {
  height: 8vh;
  display: flex;
  color: #fff;
  align-items: center;
  justify-content: space-between;
}

Calling minify here will generate a main.min.css file like so:

.App-Header { height: 8vh; display: flex; color: #fff; align-items: center; justify-content: space-between; } 

Please note: This project was made in my free time and for fun. While I did my best to follow the parsing spec, there is no gaurentee of spec compliance. There are no compliance or regression tests. If you need something like this for real uses, I would reccomend you use Servo's CSS Parser

About

An easy-to-follow CSS parser and minifier written in rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages