-
-
Save icub3d/9668727 to your computer and use it in GitHub Desktop.
Automatically change the colors of glyphicons.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read NAME HEX; do | |
for i in `find -name "*-white.svg"`; do | |
FILENAME=`echo $i | sed -e "s/white/$NAME/g"` | |
sed -e "s/#FFFFFF/$HEX/g" $i >$FILENAME | |
PNG=`echo $FILENAME | sed -e "s/svg/png/g"` | |
convert $FILENAME -transparent white $PNG | |
done | |
for i in "" "filetypes" "halflings" "social"; do | |
WHERE="_$i" | |
if [[ "$i" = "" ]]; then | |
WHERE="" | |
fi | |
CSS="$i" | |
if [[ "$CSS" = "" ]]; then | |
CSS="glyphicons" | |
fi | |
FILENAME="./glyphicons$WHERE/web/html_css/css/$NAME.css" | |
echo ".$CSS.$NAME:before { | |
color: $HEX; | |
} | |
.$CSS-icon.$NAME { | |
background-image: url(../images/glyphicons$WHERE-$NAME.svg); | |
} | |
.$CSS-icon.$NAME _:-o-prefocus, | |
.$CSS-icon.$NAME { | |
background-image: url(../images/glyphicons$WHERE-$NAME.png); | |
} | |
.no-inlinesvg .$CSS-icon.$NAME { | |
background-image: url(../images/glyphicons$WHERE-$NAME.png); | |
}" > $FILENAME | |
done | |
done < colors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
green #006600 | |
dark-blue #375EAB | |
pale-blue #E0EBF5 | |
pale-yellow #FFFFD8 | |
maroon #933 | |
orange #FF9632 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd glyphicons_pro | |
./colorize.sh | |
find -name "*.css" | fgrep -v -e MACOSX -e style.css | xargs cat >all.css | |
cp all.css ~/my/project/css | |
for i in `find -name "*.svg" -or -name "*.png" | grep html_css`; do | |
cp $i ~/my/project/images/ | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment