Starting to use a CSS minifier
I have started using the 'CSSO' CSS minifier
It only reduces the size of my game by 2%. I already used shell and Perl scripts to remove comments and remove some spaces. 'CSSO' additionally removes spaces around '{' and '}' and removes semi-colons after the last property in a rule. Sometimes 'CSSO' combines similar rules and combines properties into a 'shorthand' rule.
CSS makes up about 20% of my game. (JavaScripts makes up about 65%). This is after my game is minimised.
The size of the CSS is halved when minimised. The minified JavaScript is about 15% of the original size. JavaScript variable names can be shortened but CSS property names cannot be easily shortened. I remove some vendor-prefixed properties.
'CSSO' wrongly changes a small stylesheet to nothing. The stylesheet is:
#navigationSettings {
display: block;
}
I had to hide some empty CSS rules from 'CSSO' as it removes them. These rules have properties set in JavaScript.
The online 'playground' of the rival minifier 'cssnano' does not seem to work on the old browsers in my local libraries
I use the Linux 'fold' to look through minimised code
I say: 'fold -s -w120'fold -s -w120