common: global style options without page exceptions
[sheet.git] / common.inc.plp
index 4bc68a67ba10379fe6041fb19d1a70a060afb7d0..ff84a9ac191e950dcbe88e33fc590b79b4b7561d 100644 (file)
@@ -54,8 +54,7 @@ our $style;
 $header{content_type} = 'text/html; charset=utf-8';
 
 sub stylesheet {
-       my ($avail) = @_;
-       my @avail = ref $avail eq 'ARRAY' ? @{$avail} : $avail or return;
+       my @avail = qw( light dark circus mono red );
        my %styles = map {$_ => $_} @avail;
 
        if (defined( my $setstyle = $get{style} )) {
@@ -127,7 +126,6 @@ sub Html {
        }
 
        # default fallbacks
-       $meta->{stylesheet} ||= [qw( light dark circus mono red )];
        $meta->{charset} ||= 'utf-8';
        $meta->{lang} ||= 'en';
 
@@ -143,7 +141,7 @@ sub Html {
        unshift @{ $meta->{raw} }, (
                '<link rel="stylesheet" type="text/css" media="all" href="/light.css?1.20">',
        );
-       $meta->{stylesheet} = stylesheet($meta->{stylesheet});
+       $meta->{stylesheet} = stylesheet();
 
        if (my $img = $meta->{image}) {
                my $proto = sprintf('http%s://', !!$ENV{HTTPS} && 's');