From 37b027417ab8d386bf555f77f7c5d544a5393ca2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Jun 2018 23:55:57 +0200 Subject: [PATCH] css: strip trailing comments also for lines with variables. I am back at 8.9 kB, yay! --- css/m-dark+doxygen.compiled.css | 4 ++-- css/m-dark.compiled.css | 4 ++-- css/m-light+doxygen.compiled.css | 4 ++-- css/m-light.compiled.css | 4 ++-- css/postprocess.py | 6 +++++- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/css/m-dark+doxygen.compiled.css b/css/m-dark+doxygen.compiled.css index 83008da9..252a16d1 100644 --- a/css/m-dark+doxygen.compiled.css +++ b/css/m-dark+doxygen.compiled.css @@ -440,7 +440,7 @@ blockquote, hr { border-color: #405363; } pre { - font-family: 'Source Code Pro', monospace, monospace, monospace; /* https://en.wikipedia.org/wiki/User:Davidgothberg/Test59 */ + font-family: 'Source Code Pro', monospace, monospace, monospace; font-size: 0.9rem; padding: 0.5rem 1rem; color: #e6e6e6; @@ -1122,7 +1122,7 @@ figure.m-figure.m-dim a:hover, figure.m-figure.m-dim a:focus, figure.m-figure.m- color: #747474; } .m-imagegrid > div { - background-color: #2f363f; /* to avoid section HL shining through */ + background-color: #2f363f; } .m-imagegrid > div > figure { display: block; diff --git a/css/m-dark.compiled.css b/css/m-dark.compiled.css index c295debf..ee86e350 100644 --- a/css/m-dark.compiled.css +++ b/css/m-dark.compiled.css @@ -440,7 +440,7 @@ blockquote, hr { border-color: #405363; } pre { - font-family: 'Source Code Pro', monospace, monospace, monospace; /* https://en.wikipedia.org/wiki/User:Davidgothberg/Test59 */ + font-family: 'Source Code Pro', monospace, monospace, monospace; font-size: 0.9rem; padding: 0.5rem 1rem; color: #e6e6e6; @@ -1122,7 +1122,7 @@ figure.m-figure.m-dim a:hover, figure.m-figure.m-dim a:focus, figure.m-figure.m- color: #747474; } .m-imagegrid > div { - background-color: #2f363f; /* to avoid section HL shining through */ + background-color: #2f363f; } .m-imagegrid > div > figure { display: block; diff --git a/css/m-light+doxygen.compiled.css b/css/m-light+doxygen.compiled.css index ec48a040..835c9e28 100644 --- a/css/m-light+doxygen.compiled.css +++ b/css/m-light+doxygen.compiled.css @@ -440,7 +440,7 @@ blockquote, hr { border-color: #f7e3db; } pre { - font-family: 'Source Code Pro', monospace, monospace, monospace; /* https://en.wikipedia.org/wiki/User:Davidgothberg/Test59 */ + font-family: 'Source Code Pro', monospace, monospace, monospace; font-size: 0.9rem; padding: 0.5rem 1rem; color: #5b5b5b; @@ -1122,7 +1122,7 @@ figure.m-figure.m-dim a:hover, figure.m-figure.m-dim a:focus, figure.m-figure.m- color: #949494; } .m-imagegrid > div { - background-color: #ffffff; /* to avoid section HL shining through */ + background-color: #ffffff; } .m-imagegrid > div > figure { display: block; diff --git a/css/m-light.compiled.css b/css/m-light.compiled.css index 4b766f42..e5c82ae5 100644 --- a/css/m-light.compiled.css +++ b/css/m-light.compiled.css @@ -440,7 +440,7 @@ blockquote, hr { border-color: #f7e3db; } pre { - font-family: 'Source Code Pro', monospace, monospace, monospace; /* https://en.wikipedia.org/wiki/User:Davidgothberg/Test59 */ + font-family: 'Source Code Pro', monospace, monospace, monospace; font-size: 0.9rem; padding: 0.5rem 1rem; color: #5b5b5b; @@ -1122,7 +1122,7 @@ figure.m-figure.m-dim a:hover, figure.m-figure.m-dim a:focus, figure.m-figure.m- color: #949494; } .m-imagegrid > div { - background-color: #ffffff; /* to avoid section HL shining through */ + background-color: #ffffff; } .m-imagegrid > div > figure { display: block; diff --git a/css/postprocess.py b/css/postprocess.py index 7ca4362d..78d822bf 100755 --- a/css/postprocess.py +++ b/css/postprocess.py @@ -73,7 +73,11 @@ def postprocess(files, process_imports, out_file): if match and match['key'] in variables: out.write(match['before']) out.write(variables[match['key']]) - out.write(match['after']) + # Strip the trailing comment, if there, to save some bytes + if match['after'].endswith('*/'): + out.write(match['after'][:match['after'].rindex('/*')].rstrip()) + else: + out.write(match['after']) out.write("\n") continue -- 2.30.2