-# Copyright (C) 2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# Self-updating module containing a sample CSS for client-side
sub CSS () {
<<'_'
/*
+ * CC0-1.0 <https://creativecommons.org/publicdomain/zero/1.0/legalcode>
* Dark color scheme using 216 web-safe colors, inspired
* somewhat by the default color scheme in mutt.
* It reduces eyestrain for me, and energy usage for all:
* Underlined links add visual noise which make them hard-to-read.
* Use colors to make them stand out, instead.
*/
- a { color:#69f !important; text-decoration:none !important }
+ a:link { color:#69f !important; text-decoration:none !important }
a:visited { color:#96f !important }
/* quoted text in emails gets a different color */
# usage: perl -I lib __FILE__ contrib/css/216dark.css
# (See Makefile.PL)
if (scalar(@ARGV) == 1 && -r __FILE__) {
- use autodie;
- open my $ro, '<', $ARGV[0];
- my $css = do { local $/; <$ro> };
+ open my $ro, '<', $ARGV[0] or die $!;
+ my $css = do { local $/; <$ro> } or die $!;
# indent one level:
$css =~ s/^([ \t]*\S)/\t$1/smg;
$css =~ s/;/ !important;/sg;
$css =~ s/(\w) \}/$1 !important }/msg;
- open my $rw, '+<', __FILE__;
- my $out = do { local $/; <$rw> };
+ open my $rw, '+<', __FILE__ or die $!;
+ my $out = do { local $/; <$rw> } or die $!;
$out =~ s/^sub CSS.*^_\n\}/sub CSS () {\n\t<<'_'\n${css}_\n}/sm;
seek $rw, 0, 0;
- print $rw $out;
+ print $rw $out or die $!;
+ close $rw or die $!;
}
1;