The |compacte filter is applied to a CSS or JavaScript file[The file to which the filter is applied must have either ".js" or ".css" as its filename extension.]] and creates a compressed copy which is smaller than the original as it deletes all comments, empty declarations, unnecessary blank spaces and lines etc. [1] (for Javascript files, the filter uses the JavaScriptPacker class).

Ater having archived this new file into the local/ directory, the filter returns the link: [<link rel="stylesheet" href="(#CHEMIN{spip_style.css}|compacte)" type="text/css" media="all" />] which will return something like: <link rel="stylesheet" href="local/cache-css/spip_style-compacte-092e.css" type="text/css" media="all" />


[1For CSS files, the filter transforms all URLs in the file into absolute URLs

#div {
 background : url(../prive/images/fond-gris-anim.gif);  /** image modifiable **/
 width : 48px;
 height : 48px;
 margin : auto;



Author Mark Published : Updated : 26/10/12

Translations : català, English, Español, français, Nederlands