philipp-winterle/crittr

Extract classname

ngontayg opened this issue · 2 comments

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 😅

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.

Closing because of silence