-
Notifications
You must be signed in to change notification settings - Fork 371
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
Mismatch in computed styles after critical #541
Comments
Hey @espoal, thanks for creating this issue. Can you provide a "not working" example? I can't spot any differences in the provided links |
Hey @bezoerb thank you for your quick reply. Sorry I was playing with the repo and inadvertently deleted the route in firebase. Try again, and try And just to make it even more clear: the calendar SVG in the datepicker overlaps the date after using critical. If you want to look at the output is here, and if you want to look how I generated it it's here. If you want to try locally just fix the hard paths ( |
I tried to debug on my local machine but i'm missing the firebase token ;) <style>
...
.pl-9 {
padding-left: 2.25rem;
}
...
</style>
<link rel="stylesheet" href="/uncritical.css" media="all" onload="this.media='all'"> uncritical.css contains [type=text] {
padding-left: 0.75rem;
} but the I think it's currently not possible to place the You can try playing around with the different inlining strategies provided by critical.generate({
...
inline: {
strategy: 'default'
},
... For now i would suggest removing the |
@espoal: Any updates on this? |
@bezoerb sorry I was stuck with some backend topics, I will try to answer before monday. |
@bezoerb I'm sorry for the super late reply, and thank you very much for keeping this alive, I really appreciate it. Unfortunately time is scarce, and my attention had to be diverted on some backend topics. About the firebase issue: in theory no token is needed. Have you installed firebase emulator? what errors exactly should show? Unfortunately I tried all your tips without much success. In the end I decided that service workers are good enough: even though they are much much more complex, they provide similar benefits in term of loading. If we could make this work though, that would be amazing and I could backport it in my coworkers projects. |
After using critical, there's a mismatch in the computed styles:
Without critical, and with critical
If you patiently inspect the styles, you see there's a mismatch in the computed styles, especially
border-radius
I tried to fix the issue by using
forceInclude
to no avail. It seems that when splitting the styles, theuncritical.css
gets precedence over the inlined styles.Btw: Amazing project. I took a commercial dashboard, whose load time was around 10 second, and I brought it to 2 seconds with a lot of work (ssr, lazy load, minification...) and then to 0.8 seconds with critical. This npm had by far the most impact, with the least amount of work, it should be advertised everywhere.
The text was updated successfully, but these errors were encountered: