cl-minify-css

2020-09-25

To minify css with common lisp.

Upstream URL

github.com/noloop/cl-minify-css

Author

noloop <noloop@zoho.com>

Maintainer

noloop <noloop@zoho.com>

License

GPLv3
README

1cl-minify-css

1.0.1To minify css with common lisp.

1.1Getting Started in cl-minify-css

1.1.1Dependencies

No dependencies. Yes, I was crazy, and I did it without cl-ppcre by fun.

1.1.2Download and Load

1 - Load cl-minify-css system by quicklisp

IN PROGRESS... but will be like this: (ql:quickload :cl-minify-css)

2 - Download and load cl-minify-css system by github and asdf

download from github:

git clone https://github.com/noloop/cl-minify-css.git

and load by asdf:

(asdf:load-system :cl-minify-css)

Note: Remember to configure asdf to find your directory where you downloaded the libraries (asdf call them "systems") above, if you do not know how to make a read at: https://common-lisp.net/project/asdf/asdf/Configuring-ASDF-to-find-your-systems.html or https://lisp-lang.org/learn/writing-libraries.

1.2How to minify a css string?

(defparameter css "/*By somebody | License GPLv3*/
div,ul,li:focus {
    outline:none; /*some comment*/
    margin: 5px 0 0 1px;
}

body {
  font: 1em/150% Helvetica, Arial, sans-serif;
  padding: 1em;
  margin: 0 auto; 
  max-width: 33em;
}

@media (min-width: 70em) {
  body {
    font-size: 130%; /*more some comment*/
  }
}

h1 {
  font-size: 1.5em;
}")
(minify-css css :keep-license-p nil)
;; => "div,ul,li:focus{outline:none;margin:5px 0 0 1px;}body{font:1em/150% Helvetica, Arial, sans-serif;padding:1em;margin:0 auto;max-width:33em;}@media (min-width:70em){body{font-size:130%;}}h1{font-size:1.5em;}"
(minify-css css :keep-license-p t)
;; => "/*By somebody | License GPLv3*/div,ul,li:focus{outline:none;margin:5px 0 0 1px;}body{font:1em/150% Helvetica, Arial, sans-serif;padding:1em;margin:0 auto;max-width:33em;}@media (min-width:70em){body{font-size:130%;}}h1{font-size:1.5em;}"

1.3API

function (minify-css css &key keep-license-p)

Dependencies (2)

  • assert-p
  • cacau

Dependents (1)

  • GitHub
  • Quicklisp