-
Notifications
You must be signed in to change notification settings - Fork 373
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
>> Error opening url 'undefined': undefined #99
Comments
@vlrprbttst critical couldn't handle php files as this is a server side language which needs it's own interpreter. You could use <style><?php include 'critical.css'; ?></style>
<script>
function loadCSS(a, b, c) { … }
loadCSS('non-critical.css');
</script>
<noscript>
...
</noscript> |
oh, so no way of using it on any php site? |
@vlrprbttst i've created a gist with a working solution for using critical with php. |
thanks a lot! but do i still need to convert php to html? that's something I can't do unfortunatly |
@vlrprbttst You could use of Penthouse, create critical css for each page, and then inline if yourself via php. That's what I've been doing for my own site, with this kind of code in a php header file:
For convenience I just named my critical css exactly the same as each |
Someone else asked me the same question so I created a gist for this solution: |
@pocketjoso thanks! that's what I'm using at the moment but I was thinking of switching cause your plugin doesn't extract all the relevant css.. some are missing and that creates a pretty ugly FOUC :/ |
@vlrprbttst I always advice against extracting the critical css from the full css as I think there are only benefits to doing so in the majority of cases. |
oh ok! then I'll keep using penthouse then. I didn't understand your last statement, what do you mean? |
I think I misunderstood what you meant with |
yes exactly :) i will! |
I've just installed grunt critical on my project, this is what's in my gruntfile
and my project folder structure
i then run
grunt critical
but the task is aborted. using --verbose and --force, the only input i have is this:any idea of why this is happening? thanks!!
The text was updated successfully, but these errors were encountered: