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

Module css

source code

CSS Tools

CSS Tools.


Copyright: Copyright 2006 - 2015 André Malo or his licensors, as applicable

License:

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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
  __doc__ = __doc__.encode('ascii').decode('unicode_escape')
  __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

__doc__

Value:
__doc__.encode('ascii').decode('unicode_escape')

__package__

Value:
'tdi.tools'