Skip to content
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

Feature request: support "FULL_HEIGHT" option to allow generation of used CSS #317

Open
AlexChesser opened this issue Mar 30, 2021 · 1 comment

Comments

@AlexChesser
Copy link

AlexChesser commented Mar 30, 2021

I was pretty excited to find this today, since I was going to have a really hard time achieving our lighhouse scores without this.

As soon as I implemented the deferred CSS / inline above the fold option, I actually lost points with another issue around removing unused css rules. I see we can set viewport dimensions so I imagine that I could simply set the viewport to max-height (it's a long scrolling page with 150k height, but maybe it'll work)

As a feature request it would be nice if there was an option to ask to the whole site and output the stuff that is used rather than trying to ballpark the actual height and crossing our fingers.

This is the rule https://web.dev/unused-css-rules/

@colourgarden
Copy link

colourgarden commented Jun 22, 2022

This doesn't sound like something that's within the scope of Penthouse. Penthouse's job is to take all of your CSS and then return a portion of it based on the elements that are in an initial viewport (above the fold).

It isn't the job of Penthouse to determine any unused CSS selectors you may have elsewhere in your stylesheet and it certainly isn't the job of Penthouse to retrieve non-critical CSS further down the page.

Are you comparing the generated Penthouse stylesheet to your original stylesheet and removing the styles extracted by Penthouse? If not then you may be seeing duplicate CSS which is maybe what Lighthouse is complaining about.

More generally, I'd suggest using PurgeCSS to remove unused CSS from your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants