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

Writing the css rules in an area in a django template #167

Closed
bambamboole opened this issue Sep 17, 2016 · 2 comments
Closed

Writing the css rules in an area in a django template #167

bambamboole opened this issue Sep 17, 2016 · 2 comments

Comments

@bambamboole
Copy link

I'm building a django based project and using a base.html template file.

The main function of critical works like a charm. It extracts all used css rules out of the localhost:8000 dev server. Thumbs up for this!

But is it possible to write the extracted css rules into an extisting file for example in an placeholder or maybe inside an predefined <style data-id="critical"></style> tag, so that I don't have to copy the content in there by myself?

In my opinion, this would be a very useful enhancement of this nice tool.

cheers
bambamboole

@bezoerb
Copy link
Collaborator

bezoerb commented Nov 25, 2016

@bambamboole have you tried the inline: true option?

inline-critical has a target option to specify a selector where the critical css gets prepended. So if the default inine settings in critical doesn't work out, you could use inline-critical yourself to do the inlining for you as long as your template is parsable by cheerio

@bezoerb
Copy link
Collaborator

bezoerb commented Nov 30, 2018

Closing this as nothing happened in the last 2 years.

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

No branches or pull requests

2 participants