Fixed more layout shifts

This commit is contained in:
2025-11-23 01:37:42 +01:00
parent 51c2b1ccd3
commit 55ec8a467f
12 changed files with 42 additions and 23 deletions

View File

@@ -93,18 +93,8 @@ async function generateCriticalCSSForViews() {
},
forceInclude: [
'[data-bs-theme="dark"]',
'[data-bs-theme="dark"] *',
'body.dark',
'.navbar-dark',
'.navbar',
'.navbar-collapse',
'.dropdown',
'.dropdown-toggle',
'.dropdown-toggle::after',
'.dropdown-item',
'.dropdown-menu',
'.dropdown-menu-end',
'.dropdown-menu.show',
'.me-2',
'.align-items-center',
'.d-flex',
@@ -113,18 +103,39 @@ async function generateCriticalCSSForViews() {
'.start-0',
'.m-4',
'.row', // elements
'.row>*',
'.g-3',
'.col-md-3',
'.text-center',
'.mb-3',
'.mb-4',
'.mt-3',
'.py-4',
'.text-center',
'h2',
'.form-control',
'.btn',
'.btn-secondary',
'.form-control-sm',
'.modal',
'.btn',
'.btn-sm',
'.btn-secondary',
'.btn-warning',
'.btn-danger',
'.rounded-circle', // user icon
'table', // table elements (users)
'.table>thead',
'.user-row > td',
'thead',
'tbody',
'th',
'tr',
'td',
'.table>:not(caption)>*>*',
'.table-striped>tbody>tr:nth-of-type(odd)>*',
'.gap-2',
'.table',
'.table-responsive',
'.align-middle'
]
},
target: {
@@ -143,3 +154,11 @@ async function generateCriticalCSSForViews() {
// Run the function
generateCriticalCSSForViews().catch(console.error);
// How to run this:
// install dependencies:
// npm i -D critical
// npm install puppeteer
// run:
// node critical.js