philipp-winterle / crittr

High performance critical css extraction with a great configuration abilities
https://hummal.github.io/crittr/
GNU General Public License v3.0
51 stars 6 forks source link

Extract classname #50

Closed ngontayg closed 5 months ago

ngontayg commented 8 months ago

Hi, Thank you for a wonderful lib,

I wonder if is there a way to extract/return all classname of all Above-the-fold contents? Also, what is the "returns the remaining css" please? as when i run i only get one single css file.

Sorry for a noob question 😅

philipp-winterle commented 7 months ago

Hey @ngontayg ✋🏻

you are asking to extract only the class names right? Because you already get all class names and their contents with the atf. If so, why would you need the class names only? I can not see any benefit of only having class names in terms of above the fold css extraction. If you are using the class names programatically to do something with it, I would suggest writing an own script to get the class names out of the extracted css. It is more like a regex replace.

Remaining CSS is the rest of the css which is not part of the above the fold css. If you have 100% of your css and 20% of that is in the ATF, then the remaining css is the remaining 80%.

This is used by me to insert the ATF CSS in the head style part to be available after the document is loaded and so no flickering exists. The remaining CSS is inserted after document load to speed up loading times.

philipp-winterle commented 5 months ago

Closing because of silence