Package cssutils :: Package scripts :: Module csscombine'
[hide private]
[frames] | no frames]

Module csscombine'

source code

combines sheets referred to by @import rules in a given CSS proxy sheet into a single new sheet.

Example:

csscombine sheets\csscombine-proxy.css -m -t ascii -s utf-8
    1>combined.css 2>log.txt

results in log.txt:

COMBINING sheets\csscombine-proxy.css
USING SOURCE ENCODING: utf-8
* PROCESSING @import sheets\csscombine-1.css
* PROCESSING @import sheets\csscombine-2.css
SETTING TARGET ENCODING: ascii

and combined.css:

@charset "ascii";a{color:green}body{color:#fff;background:#000}

or without option -m:

@charset "ascii";
/* proxy sheet which imports sheets which should be combined \F6 \E4 \FC  */
/* @import "csscombine-1.css"; */
/* combined sheet 1 */
a {
    color: green
    }
/* @import url(csscombine-2.css); */
/* combined sheet 2 */
body {
    color: #fff;
    background: #000
    }

issues


Version: $Id: csscombine.py 1116 2008-03-05 13:52:23Z cthedot $

Functions [hide private]
 
csscombine(proxypath, sourceencoding=None, targetencoding='utf-8', minify=True)
Returns: combined cssText
source code
 
main(args=None) source code

Imports: CSSSerializer, cssutils, os, sys


Function Details [hide private]

csscombine(proxypath, sourceencoding=None, targetencoding='utf-8', minify=True)

source code 
Returns:
combined cssText

Parameters:

proxypath:

url or path to a CSSStyleSheet which imports other sheets which are then combined into one sheet

sourceencoding:

encoding of the source sheets including the proxy sheet

targetencoding = 'utf-8':

encoding of the combined stylesheet

minify = True:

defines if the combined sheet should be minified