Jump to >

reviewboard.extensions.packaging

class BuildStaticFiles(dist, **kw)[source]
get_lessc_global_vars()[source]

Returns a dictionary of LessCSS global variables and their values.

This can be implemented by subclasses to provide global variables for .less files for processing.

By default, this defines two variables: STATIC_ROOT and DEBUG.

STATIC_ROOT is set to /static/. Any imports using @{STATIC_ROOT} will effectively look up the requested file in <import_path>/@{STATIC_ROOT}. This assumes that the project serving the static files keeps them in static/appname/.

Projects using less.js for the runtime can then define STATIC_ROOT to settings.STATIC_URL, ensuring lookups work for development and packaged extensions.

DEBUG is set to false. Runtimes using less.js can set this to settings.DEBUG for templates. This can be useful for LessCSS guards.

This requires LessCSS 1.5.1 or higher.