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