| scala 2.13 | scala 3 |
|---|---|
This library is a simple, dependency free css minifier supporting Scala 2.13, 3 on JVM, JS and Native Platform.
Algorithm is written in reference to YUI or.
Following features are supported.
- remove leading whitespace-like chars
- remove trailing whitespace-like chars
- remove last semi-colon in braces
- remove repeated semi-colons
- remove comments except ones start with
! - remove empty rules
- compress zeros(e.g.
margin:0 0 0 0; => margin:0,border:none;=>border:0) - collect
@charsetand keep only the first one
libraryDependencies += "dev.i10416" %% "cssminifier" % "0.0.2"For JS or Native platform, use %%% instead of %%.
libraryDependencies += "dev.i10416" %%% "cssminifier" % "0.0.2"import dev.i10416.CSSMinifier
CSSMinifier.run("<css string>")- Give it a star⭐
- Drop the feedback to the author @i10416
- Send a PR with fixes of typos/bugs/etc🐛
Licensed under the Apache License, Version 2.0.