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

Multi-SCSS transpilation wrong styles applied #10

Open
stickeedavid opened this issue Feb 27, 2020 · 0 comments
Open

Multi-SCSS transpilation wrong styles applied #10

stickeedavid opened this issue Feb 27, 2020 · 0 comments

Comments

@stickeedavid
Copy link

Hi all,

I'm putting this here in case anyone else has the same issue.

Issue:
CSS classes are being applied incorrectly to above-the-fold content.

Cause:
We build several CSS files but do not include all of them on the page we are building critical CSS for. However,
CriticalCSS loads all built CSS via webpack, rather than what is included in the HTML document.

Solutions:

  • Add an ID to the body, and wrap all CSS within that ID.

    OR

  • Manually specific the CSS filepaths to include via the Critical 'CSS' option. e.g.
    options: { css: [ 'public/css/A.css' ] }

Any better solutions would be appreciated.

Thanks

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

1 participant