WWW::Bootstrap - fetch, build and use the Bootstrap CSS Framework


    use WWW::Bootstrap;

    my $bootstrap = WWW::Bootstrap->(workdir => '/tmp');

    # set a few variables
    $bootstrap->set_variable(body-bg => '#fefefe');
    $bootstrap->set_variable(font-base-size => '15px');

    # fetch the bootstrap archive from github
    # OR use a local copy of the github archive

    # update the *.less files

    # generate the css and js files

    # copy the files to your document root


WWW::Bootstrap wrapps downloading, editing less files and generating css files for the Bootstrap framework



Create a new Bootstrap Instance. Valid arguments are:

workdir => $path

Path to the working directory to use.

Defaults to /tmp/bootstrap

dl_url => $url

URL to download bootstrap source archive.

Defaults to

disabled_features => [ $feature1, $feature2, ... ]

List of features to disable during build-time.

See also: "disable_feature($feature)"

variables => { $var1 => $val1, $var2 => $val2 }

Hash refernce of variables to be overwritten in varaibles.less

See also: "set_variable($var => $val)"


Disable a feature during buildtime by disabling the matching lessfile. $feature must be the namepart of a file in less/, for example "scaffolding" for less/scaffolding.less:

set_variable($var => $val)

Set the value of a variable in variables.less. $var must be the variable name without leading @.

    $boostrap->set_value(body-bg => '#fefefe');

For a full list of variables, have a look at


Fetch and extract the bootstrap sourcecode from github. If the optional parameter $zipfile is given, it will be used as path to a local copy of the ZIP file, instead of fetching it via HTTP.


Updates the less/*.less files to reflect the currently disabled features and the updated variables.


Generates the CSS and JS files. After the process is done, the new files are located in the bootstrap-master/dist folder in the working directory.


Copies the current content of the dist/ folder to the $target_dir. If @path_elements, the elements will be used to construct the target path with "catfile" in File::Spec. The target directory will be created if it does not already exist.


The build process requires node.js to be installed to generate the CSS and JS files.


Thomas Berger <>


This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.