Skip to content
/ css Public

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

License

Notifications You must be signed in to change notification settings

brenapp/css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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