addyosmani / addyosmani/critical

Mismatch in computed styles after critical

Đang mở
#541 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
awaiting reply
Ngôn ngữ chính
JavaScript
Star
10.3k
Fork
390
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

After using critical, there's a mismatch in the computed styles:

![Screenshot from 2022-08-05 16-31-36](https://user-images.githubusercontent.com/7604623/183099006-9e34cf62-6269-4fd9-93cf-545ecb1818ac.png)

[Without critical](https://pwapp-24858.web.app/dash), and [with critical](https://pwapp-24858.web.app/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](https://github.com/espoal/pwapp/blob/main/libs/critical/index.mjs) by using `forceInclude` to no avail. It seems that when splitting the styles, the `uncritical.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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.