NAME
WebServer::DirIndex::CSS - CSS stylesheets for directory index pages
SYNOPSIS
use WebServer::DirIndex::CSS;
my $css = WebServer::DirIndex::CSS->new->css; # standard CSS
my $css = WebServer::DirIndex::CSS->new(pretty => 1)->css; # pretty CSS
DESCRIPTION
This module provides CSS stylesheets that can be used to style directory index pages served by web servers.
CONSTRUCTOR
- new(%args)
-
Creates a new
WebServer::DirIndex::CSSobject. Accepts the following optional named parameter:- pretty
-
If true, the
cssmethod will return an enhanced stylesheet for a more attractive appearance. Defaults to false.
METHODS
- css
-
Returns a CSS stylesheet suitable for directory listing pages. If the
prettyattribute is true, returns an enhanced stylesheet for a more attractive appearance; otherwise returns a minimal standard stylesheet. - standard_css
-
Returns the minimal standard CSS stylesheet string.
- pretty_css
-
Returns the enhanced pretty CSS stylesheet string.
SUBCLASSING
You can subclass this module to provide custom stylesheets. Override standard_css, pretty_css, or both by declaring new fields with the :reader attribute, and override the css method if you need different selection logic.
Pass your subclass name as the css_class parameter when constructing WebServer::DirIndex.
AUTHOR
Dave Cross <dave@perlhacks.com>
COPYRIGHT
Copyright (c) 2026 Magnum Solutions Limited. All rights reserved.
LICENCE
This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.