Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadCSS integration #730

Open
Flimm opened this issue Jan 21, 2016 · 2 comments
Open

loadCSS integration #730

Flimm opened this issue Jan 21, 2016 · 2 comments
Labels

Comments

@Flimm
Copy link

Flimm commented Jan 21, 2016

It would be cool if we could integrate loadCSS with this somehow. All that would be needed is for a templatetag to output just the filename of the generated minified and concatenated CSS file.

Like this:

{% compress js inline %}
<script src="loadCSS.js"></script>
<script>loadCSS('{% compressurl css "styles.css" | escapejs %}');</script>
{% endcompress %}

Which would generate:

<script>
/* Replace this line with source for loadCSS.js minified */
/* ... */

loadCSS("/static/CACHE/css/f7c661b7a124.css");

</script>
@karyon karyon added the feature label Apr 24, 2016
@karyon
Copy link
Contributor

karyon commented Apr 24, 2016

ref #294, as far as i can see this is implemented there

@pgcd
Copy link

pgcd commented Sep 7, 2017

Until the PR is merged, I have solved this by subclassing: https://gist.github.com/pgcd/509bb1c2fec867fa46c6c6ba8c33c62e - you just need to save the files in the right places and use the DeferredCssCompressor as COMPRESS_CSS_COMPRESSOR.

(We're using this in production with our setup, so I know it works for our use case, but of course YMMV)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants