\CSSBlubberTask
Runs a task that analyses CSS in the theme directory for bloat.
Stages:
1. Prompt user for what CSS files should be included (i.e. exlcude any .min.css files)
2. Load all the .ss templates in the manifest, and store their html contents in memory
3. Given user-defined rules of actual pages to sample, load a collection of actual
URLs, using Director::test(), to get actual rendered html
4. For each included stylesheet, parse it, and check each rule against all the html "samples",
both unrendered and rendered templates
5. Given the "good" pile and "bad" pile, create a ".lean.css" and ".blubber.css" version of
each included CSS file
- Author: Uncle Cheese <unclechese@leftandmain.com>
Synopsis
class CSSBlubberTask
extends CliController
{
- // members
- protected array $cssFiles = ;
- protected $theme;
- protected $cssDir;
- protected Finder $finder;
- protected Outputter $output;
- protected array $samples = ;
- private static $theme_css_dir;
- // methods
- public void __construct()
- public void index()
- protected void gatherCSSFiles()
- protected void loadTemplates()
- protected void loadURLs()
- protected string getSampleForObject()
Hierarchy
Extends
- CliController
Members
private
- $theme_css_dir
—
string
An path where CSS resides
protected
- $cssDir
—
string
An absolute path to the directory where CSS resides for this project - $cssFiles
—
array
A list of CSS files to ananlyst - $finder
—
Symfony\Component\Finder
A reference to the file finder tool - $output
—
Outputter
A reference to the outputter interface - $samples
—
array
An array of HTML samples - $theme
—
string
The theme to analyse
Methods
protected
- gatherCSSFiles() — Collects all the CSS files per the user's approval
- getSampleForObject() — Given a DataObject, get an actual SS_HTTPResponse of rendered HTML
- loadTemplates() — Loads all the static .ss templates as HTML into memory
- loadURLs() — Loads all URLs to sample rendered content, per confirguration
public
- __construct() — Constructor
- index() — Runs the task