def css(context, bundle, media=False, debug=None): if debug is None: debug = settings.TEMPLATE_DEBUG # ?debug=true gives you unminified CSS for testing on -dev/prod. if context['request'].GET.get('debug'): debug = True return jingo_minify_helpers.css(bundle, media, debug)
def less_css(bundle): """ Similar to jingo_minify's css helper, but uses rel="stylesheet/less" instead of rel="stylesheet" when TEMPLATE_DEBUG is True. If TEMPLATE_DEBUG is False, this passes the call on to the css helper. """ if not settings.TEMPLATE_DEBUG: return css(bundle) urls = get_css_urls(bundle) link_tag = '<link rel="stylesheet/less" media="screen,projection,tv" href="{0}" />' return Markup('\n'.join([link_tag.format(url) for url in urls]))