2017 © Pedro Peláez
 

silverstripe-module minify

Minifies CSS requirements using Minify (http://code.google.com/p/minify/)

image

nathancox/minify

Minifies CSS requirements using Minify (http://code.google.com/p/minify/)

  • Tuesday, August 15, 2017
  • by nathancox
  • Repository
  • 4 Watchers
  • 27 Stars
  • 24,391 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 8 Forks
  • 4 Open issues
  • 4 Versions
  • 11 % Grown

The README.md

SilverStripe Minify CSS Module

This module replaces part of the Requirements system to compress CSS files using http://code.google.com/p/minify/. The idea and implementation are basically stolen from Tonyair (http://www.silverstripe.org/general-questions/show/14206), (*1)

Maintainer

Nathan Cox (nathan@flyingmonkey.co.nz), (*2)

Requirements

SilverStripe 3.1+ Check out the SS-3.0 branch for a version compatible with SS 3.0, (*3)

Installation Instructions

  1. Place the files in a directory called "minify" in the root of your SilverStripe installation
  2. Visit yoursite.com/dev/build

Usage

The module will automatically replace the Requirements backend with a custom subclass, so you don't need to do anything differently., (*4)

Just use combine_files to include your CSS as normal:, (*5)

<?php

$themeFolder = $this->ThemeDir();

$files = array(
    $themeFolder . '/css/layout.css',
    $themeFolder . '/css/typography.css',
    $themeFolder . '/css/form.css'
);

Requirements::combine_files("common.min.css", $files);

Your CSS files will automatically be minified when combining (like JavaScript is)., (*6)

By default relative urls in the CSS files (eg background-image:url('../images/background.png');) will be rewritten so the combined CSS file can be kept in assets (eg to background-image:url('/themes/mytheme/images/background.png');) but you can turn this behaviour off by putting the following line in your _config.php:, (*7)

<?php

Config::inst()->update('Minify_Requirements_Backend', 'rewrite_uris', false);

Known Issues

Issue Tracker, (*8)

Credits

JSMin Minify, (*9)

The Versions

15/08 2017

dev-master

9999999-dev

Minifies CSS requirements using Minify (http://code.google.com/p/minify/)

  Sources   Download

The Requires

 

by Nathan Cox

silverstripe minify

15/08 2017

v2.0.0

2.0.0.0

Minifies CSS requirements using Minify (http://code.google.com/p/minify/)

  Sources   Download

The Requires

 

by Nathan Cox

silverstripe minify

21/12 2015

1

1.0.0.0

Minifies CSS requirements using Minify (http://code.google.com/p/minify/)

  Sources   Download

The Requires

 

by Nathan Cox

silverstripe minify

11/06 2014

dev-SS-3.0

dev-SS-3.0

Minifies CSS requirements using Minify (http://code.google.com/p/minify/)

  Sources   Download

The Requires

 

by Nathan Cox

silverstripe minify