Commit 81fcafe2 authored by skingrapher's avatar skingrapher
Browse files

update

parent 4f1b3aed
......@@ -83,13 +83,13 @@ default for both: 0
```
css.sh -o le [-h float] -i file.css
```
- **-h**: line height value (unitless). default: 1.5
- **-H**: line height value (unitless). default: 1.5
### colors
```
css.sh -o co [-r color] [-d] -i file.css
```
- **-r**: referent color for contrast enhancement. colors are contrasted in rapport with referent color. default: white
- **-R**: referent color for contrast enhancement. colors are contrasted in rapport with referent color. default: white
- **-d**: daltonize. colors are contrasted before daltonization
- **-i**: can be a file.CO.scss (see output)
......
......@@ -35,15 +35,15 @@
BSD=$(uname -s|grep -e BSD -c)
# DEFAULT BOOLEAN OPTIONS
FAMILY=
DALTONIZE=0
DALTONIZE=
LINE_HEIGHT=
CSS_FILTER_PROP=
CSS_ALL=0
CSS_ALL=
CSS_FILE=
PRETTY=
MINI=
REF=
REM=
REM=16
ROOT_FS=
LETTER_SPACING=
WORD_SPACING=
......@@ -69,37 +69,95 @@ function _minify() {
# FILTERING PROPERTIES
function _fs() {
if [ ! -z $CSS_FILE ] ; then
ROOT_FONT_SIZE=$($AWK -f root_font_size.awk $CSS_FILE)
CUSTOM_FONT_SIZE=
$AWK -v ROOT_FONT_SIZE=$ROOT_FONT_SIZE -f fs.awk $CSS_FILE 1> _${CSS_FILE%%.*}.FS.scss
if [ -z $ROOT_FS ]; then
ROOT_FS=$($AWK -f root_font_size.awk $CSS_FILE)
fi
if [ -z $CUSTOM_FS ]; then
if [ ! -z $REM ]; then
$AWK -v ROOT_FONT_SIZE=$ROOT_FS -v REM=$REM -f fs.awk $CSS_FILE 1> _${CSS_FILE%%.*}.FS.scss
else
$AWK -v ROOT_FONT_SIZE=$ROOT_FS -f fs.awk $CSS_FILE 1> _${CSS_FILE%%.*}.FS.scss
fi
else
if [ ! -z $REM ]; then
$AWK -v ROOT_FONT_SIZE=$ROOT_FS -v CUSTOM_FONT_SIZE=$CUSTOM_FS -v REM=$REM -f fs.awk $CSS_FILE 1> _${CSS_FILE%%.*}.FS.scss
else
$AWK -v ROOT_FONT_SIZE=$ROOT_FS -v CUSTOM_FONT_SIZE=$CUSTOM_FS -f fs.awk $CSS_FILE 1> _${CSS_FILE%%.*}.FS.scss
fi
fi
echo "font size styles have been listed in _${CSS_FILE%%.*}.FS.scss"
fi
}
function _co() {
if [ ! -z $CSS_FILE ] ; then
$AWK -f co_rules.awk $CSS_FILE 1> _${CSS_FILE%%.*}.CO.scss
echo "color styles have been listed in _${CSS_FILE%%.*}.CO.scss"
$AWK -f prt.awk _${CSS_FILE%%.*}.CO.scss > _${CSS_FILE%%.*}.CO.prt.scss
echo "daltonized colors for protanopia have been listed in _${CSS_FILE%%.*}.CO.prt.scss"
IS_CO=$( echo $CSS_FILE |grep -e "CO.scss" -c )
if [ $IS_CO == 0 ]; then
$AWK -f co_rules.awk $CSS_FILE 1> _${CSS_FILE%%.*}.CO.scss
echo "color styles have been listed in _${CSS_FILE%%.*}.CO.scss"
fi
TEMP_FILE=$(basename $CSS_FILE CO.scss | sed 's/^_//;s/\./.scss/')
cp $CSS_FILE $TEMP_FILE
CSS_FILE=$TEMP_FILE
if [ -z $REF ] ; then
echo "referent color for contrast: white"
$AWK -f contrast.awk $CSS_FILE 1> _${CSS_FILE%%.*}.CO.contrast.scss
else
echo "referent color for contrast: " $REF
$AWK -f contrast.awk -v REF=$REF $CSS_FILE 1> _${CSS_FILE%%.*}.CO.contrast.scss
fi
echo "contrasted colors styles have been listed in _${CSS_FILE%%.*}.CO.scss"
rm $TEMP_FILE
if [ ! -z $DALTONIZE ] ; then
$AWK -f prt.awk _${CSS_FILE%%.*}.CO.contrast.scss > _${CSS_FILE%%.*}.CO.prt.scss
echo "daltonized colors for PROTANOPIA have been listed in _${CSS_FILE%%.*}.CO.prt.scss"
$AWK -f dtr.awk _${CSS_FILE%%.*}.CO.contrast.scss > _${CSS_FILE%%.*}.CO.dtr.scss
echo "daltonized colors for DEUTERANOPIA have been listed in _${CSS_FILE%%.*}.CO.dtr.scss"
$AWK -f trt.awk _${CSS_FILE%%.*}.CO.contrast.scss > _${CSS_FILE%%.*}.CO.trt.scss
echo "daltonized colors for TRITANOPIA have been listed in _${CSS_FILE%%.*}.CO.trt.scss"
fi
fi
}
function _ff() {
if [ ! -z $CSS_FILE ] ; then
$AWK -f ff.awk $CSS_FILE 1> _${CSS_FILE%%.*}.FF.scss
if [ ! -z $FAMILY ] ; then
$AWK -f ff.awk -v FONT_FAMILY=$FAMILY $CSS_FILE 1> _${CSS_FILE%%.*}.FF.scss
else
$AWK -f ff.awk $CSS_FILE 1> _${CSS_FILE%%.*}.FF.scss
fi
echo "font family styles have been listed in _${CSS_FILE%%.*}.FF.scss"
fi
}
function _le() {
if [ ! -z $CSS_FILE ] ; then
$AWK -f le.awk $CSS_FILE 1> _${CSS_FILE%%.*}.LE.scss
if [ ! -z $LINE_HEIGHT ] ; then
$AWK -f le.awk -v LINE_HEIGHT=$LINE_HEIGHT $CSS_FILE 1> _${CSS_FILE%%.*}.LE.scss
else
$AWK -f le.awk $CSS_FILE 1> _${CSS_FILE%%.*}.LE.scss
fi
echo "leading rules have been listed in _${CSS_FILE%%.*}.LE.scss"
fi
}
function _tr() {
if [ ! -z $CSS_FILE ] ; then
$AWK -f tr.awk $CSS_FILE 1> _${CSS_FILE%%.*}.TR.scss
if [ -z $LETTER_SPACING && -z $WORD_SPACING ] ; then
$AWK -f tr.awk $CSS_FILE 1> _${CSS_FILE%%.*}.TR.scss
elif [ ! -z $LETTER_SPACING && -z $WORD_SPACING ] ; then
$AWK -f tr.awk -v LETTER_SPACING=$LETTER_SPACING $CSS_FILE 1> _${CSS_FILE%%.*}.TR.scss
elif [ -z $LETTER_SPACING && ! -z $WORD_SPACING ] ; then
$AWK -f tr.awk -v WORD_SPACING=$WORD_SPACING $CSS_FILE 1> _${CSS_FILE%%.*}.TR.scss
else
$AWK -f tr.awk -v LETTER_SPACING=$LETTER_SPACING -v WORD_SPACING=$WORD_SPACING $CSS_FILE 1> _${CSS_FILE%%.*}.TR.scss
fi
echo "tracking rules have been listed in _${CSS_FILE%%.*}.TR.scss"
fi
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment