From 9bdb4edf66382d61e6548822d1120011afbe2209 Mon Sep 17 00:00:00 2001 From: Youmin Ha Date: Thu, 7 Mar 2013 19:04:00 +0900 Subject: [PATCH] build: Trim compiled CSS files Trims compiled CSS files from less, which removes .LESS* classes(actually LESS mixins). Change-Id: I0387b4dc7481b365b28e391baa83d5dbc3e4432a --- src/themes/tizen/tizen-white/Makefile | 1 + tools/CSS-trim.sh | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100755 tools/CSS-trim.sh diff --git a/src/themes/tizen/tizen-white/Makefile b/src/themes/tizen/tizen-white/Makefile index b7bf71f..3ccf159 100644 --- a/src/themes/tizen/tizen-white/Makefile +++ b/src/themes/tizen/tizen-white/Makefile @@ -56,6 +56,7 @@ less: prepare if test "config.less" = "$$f" ; then continue; fi; \ echo " build $$f"; \ lessc $$f > $$f.css; \ + $(CURDIR)/../../../../tools/CSS-trim.sh $$f.css; \ done; css: prepare less diff --git a/tools/CSS-trim.sh b/tools/CSS-trim.sh new file mode 100755 index 0000000..90d8fa6 --- /dev/null +++ b/tools/CSS-trim.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if test -f $1; then + file=$1; +else + exit 1; +fi + +echo " Trim $file"; +sed -i -e ':a;N;$!ba;s/.ui[-a-z\,\ \.]* {\n \/\*[-a-zA-Z0-9\,\(\)\ \#\_\.\%\!\*\@\:\;\t\n]*\*\/\n\n}//g' $file; +sed -i -e ':a;N;$!ba;s/.LESS[a-zA-Z0-9]*[_[a-zA-Z0-9]*]* {\n[-a-zA-Z0-9\,\(\)\ \#\_\.\%\!\*\@\/\*\:\;\t\n]*}//g' $file; -- 2.7.4