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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -25,7 +25,7 @@
} }
</style> </style>
<link rel="preload" href="~/lib/bootstrap/dist/css/bootstrap.min.css" as="style"/> <link rel="preload" href="~/lib/bootstrap/dist/css/bootstrap.min.css" as="style"/>
<link rel="stylesheet" <link rel="stylesheet" fetchpriority="high"
href="~/lib/bootstrap/dist/css/bootstrap.min.css" href="~/lib/bootstrap/dist/css/bootstrap.min.css"
media="print" media="print"
onload="this.media='all'"> onload="this.media='all'">

View File

@@ -93,18 +93,8 @@ async function generateCriticalCSSForViews() {
}, },
forceInclude: [ forceInclude: [
'[data-bs-theme="dark"]', '[data-bs-theme="dark"]',
'[data-bs-theme="dark"] *',
'body.dark',
'.navbar-dark',
'.navbar', '.navbar',
'.navbar-collapse',
'.dropdown',
'.dropdown-toggle',
'.dropdown-toggle::after',
'.dropdown-item',
'.dropdown-menu', '.dropdown-menu',
'.dropdown-menu-end',
'.dropdown-menu.show',
'.me-2', '.me-2',
'.align-items-center', '.align-items-center',
'.d-flex', '.d-flex',
@@ -113,18 +103,39 @@ async function generateCriticalCSSForViews() {
'.start-0', '.start-0',
'.m-4', '.m-4',
'.row', // elements '.row', // elements
'.row>*',
'.g-3', '.g-3',
'.col-md-3', '.col-md-3',
'.text-center', '.text-center',
'.mb-3', '.mb-3',
'.mb-4',
'.mt-3', '.mt-3',
'.py-4', '.py-4',
'.text-center', '.text-center',
'h2', 'h2',
'.form-control', '.form-control',
'.btn', '.form-control-sm',
'.btn-secondary',
'.modal', '.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: { target: {
@@ -143,3 +154,11 @@ async function generateCriticalCSSForViews() {
// Run the function // Run the function
generateCriticalCSSForViews().catch(console.error); generateCriticalCSSForViews().catch(console.error);
// How to run this:
// install dependencies:
// npm i -D critical
// npm install puppeteer
// run:
// node critical.js