Created
September 7, 2017 05:12
-
-
Save pgcd/509bb1c2fec867fa46c6c6ba8c33c62e to your computer and use it in GitHub Desktop.
DeferredCSSCompressor for django-compressor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from compressor.css import CssCompressor | |
class DeferredCssCompressor(CssCompressor): | |
template_name_file = 'deferred_compressed_css.html' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript">loadCSS("{{ compressed.url }}", null{% if compressed.media %},"{{ compressed.media }}"{% endif %})</script> | |
<noscript> | |
<link rel="stylesheet" href="{{ compressed.url }}" type="text/css"{% if compressed.media %} media="{{ compressed.media }}"{% endif %} /> | |
</noscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment