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

How to inline CSS to control Content Layout Shift metric #38

Open
2 tasks done
SuslegStyle opened this issue Nov 10, 2021 · 0 comments
Open
2 tasks done

How to inline CSS to control Content Layout Shift metric #38

SuslegStyle opened this issue Nov 10, 2021 · 0 comments

Comments

@SuslegStyle
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Hi There.

I use Google PageSpeed Insights tool time to time for monitoring our website metrics.
It has the Content Layout Shift (CLS) metrics which is poor by default to me.

I'd like to know is any way how to pass minimum critical css styles from Vue components to main layout (client.vue) or even to index.hml to avoid CLS issues ?

As a workaround, right now I have to do the following things:

  1. To define manually minimum critical css in client.vue, or any other Page Vue components
const minCriticalCss = {
  style: [{
    type: 'text/css',
    children: '<important content>'
  }]
};
  1. To pass minCriticalCss to useHead call.

But, it is obviously akward to maintain. What alternativies can you recommend ?

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