script for quick&dirty CSS minification - www.codemadness.org - www.codemadness.org saait content files (HTM) git clone git://git.codemadness.org/www.codemadness.org (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 00565f69e5820918407df86fdead50c086efd048 (DIR) parent bbfea123b1a0287a760e160df16a3cdcefdece17 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Thu, 8 Jul 2021 23:18:01 +0200 script for quick&dirty CSS minification Diffstat: A scripts/minifycss.sh | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) --- (DIR) diff --git a/scripts/minifycss.sh b/scripts/minifycss.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# quick & dirty CSS minifier, sometimes it works(tm). +sed -E \ + -e 's@^[[:space:]]*@@g' \ + -e 's@[[:space:]]*$@@g' | \ +tr -d '\n' | \ +tr -d '\r' | \ +sed -E \ + -e 's@([:,])[[:space:]]*@\1@g' \ + -e 's@[[:space:]]*{@{@g'