Package tdi :: Package tools :: Module css
[frames] | no frames]

Module css

source code

CSS Tools.


Author: André Malo

Classes
  CSSInlineFilter
TDI filter for modifying inline css
Functions
basestring
cleanup(style, encoding=None)
Cleanup a single CSS buffer
source code
basestring
cdata(style, encoding=None)
Add a failsafe CDATA container around a style
source code
basestring
minify(style, encoding=None)
Minify CSS (using rcssmin)
source code
 
MinifyFilter(builder, minifier=None, standalone=False)
TDI Filter for minifying inline CSS
source code
 
CDATAFilter(builder, standalone=False)
TDI filter for adding failsafe CDATA containers around CSS styles
source code
Variables
  __package__ = 'tdi.tools'
Function Details

cleanup(style, encoding=None)

source code 

Cleanup a single CSS buffer

This methods removes CDATA and starting/finishing comment containers.

Parameters:
  • style (basestring) - Buffer to cleanup
  • encoding (str) - Encoding in case that toescape is a str. If omitted or None, no encoding is applied and style is expected to be ASCII compatible.
Returns: basestring
The cleaned up buffer, typed as input

cdata(style, encoding=None)

source code 

Add a failsafe CDATA container around a style

See <http://lists.w3.org/Archives/Public/www-html/2002Apr/0053.html> for details.

Parameters:
  • style (basestring) - JS to contain
  • encoding (str) - Encoding in case that toescape is a str. If omitted or None, no encoding is applied and style is expected to be ASCII compatible.
Returns: basestring
The contained style, typed as input

minify(style, encoding=None)

source code 

Minify CSS (using rcssmin)

Parameters:
  • style (basestring) - CSS to minify
  • encoding (str) - Encoding in case that toescape is a str. If omitted or None, no encoding is applied and style is expected to be ASCII compatible.
Returns: basestring
Minified CSS, typed as input

MinifyFilter(builder, minifier=None, standalone=False)

source code 
TDI Filter for minifying inline CSS
Parameters:
  • minifier (callable``) - Minifier function. If omitted or None, the builtin minifier is applied.

  • standalone (bool) - Standalone context? In this case, we won't watch out for TDI attributes.

CDATAFilter(builder, standalone=False)

source code 

TDI filter for adding failsafe CDATA containers around CSS styles

See <http://lists.w3.org/Archives/Public/www-html/2002Apr/0053.html> for details.

Parameters:
  • standalone (bool) - Standalone context? In this case, we won't watch out for TDI attributes.

Variables Details

__package__

Value:
'tdi.tools'