File Coverage

blib/lib/WebServer/DirIndex/CSS.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package WebServer::DirIndex::CSS; # For cpanm :-(
2              
3 2     2   92711 use strict;
  2         4  
  2         102  
4 2     2   10 use warnings;
  2         4  
  2         101  
5 2     2   440 use Feature::Compat::Class;
  2         364  
  2         13  
6              
7             our $VERSION = '0.1.4';
8              
9             class WebServer::DirIndex::CSS {
10              
11             field $pretty :param = 0;
12              
13             field $standard_css :reader = <
14             table {
15             width: 100%;
16             }
17             .icon {
18             width: 1.5em;
19             text-align: center;
20             }
21             .name {
22             text-align: left;
23             }
24             .size, .mtime {
25             text-align: right;
26             }
27             .type {
28             width: 11em;
29             }
30             .mtime {
31             width: 15em;
32             }
33             CSS
34              
35             field $pretty_css :reader = <
36             body {
37             color: #000;
38             background-color: #fff;
39             font-family: Calibri, Candara, Segoe, Segoe UI, Helvetica Neue, Helvetica, Optima, Arial, sans-serif;
40             font-size: normal 1em sans-serif;
41             text-align: center;
42             padding: 0;
43             margin: 0;
44             }
45              
46             h2 {
47             font-size: 2.000em;
48             font-weight: 700;
49             }
50              
51             table {
52             width: 90%;
53             margin: 3em;
54             border: 1px solid #aaa;
55             border-collapse: collapse;
56             background-color: #eee;
57             }
58              
59             thead {
60             background-color: #bbb;
61             font-weight: 700;
62             font-size: 1.300em;
63             }
64              
65             td, th {
66             padding: 1em;
67             text-align: left;
68             border-bottom: 1px solid #999999;
69             color: #000;
70             }
71              
72             tr:nth-child(even) {
73             background: #ccc;
74             }
75              
76             .icon {
77             width: 1.5em;
78             text-align: center;
79             }
80              
81             .size {
82             text-align: right;
83             padding-right: 1.700em;
84             }
85              
86             a:link {
87             font-size: 1.200em;
88             font-weight: 500;
89             color: #000;
90             text-decoration: none;
91             }
92              
93             a:link:hover {
94             text-decoration: underline;
95             }
96              
97             a:visited {
98             font-size: 1.200em;
99             font-weight: 500;
100             color: #301934;
101             text-decoration: none;
102             }
103             CSS
104              
105             method css {
106             return $pretty ? $pretty_css : $standard_css;
107             }
108             }
109              
110             1;
111              
112             __END__