fix(home): equalize process cards after fonts load
- deferred height-equalization script in `HomeProcess.astro` to `document.fonts.ready` - card heights now measured with correct web fonts in all environments, not just Vite dev server
This commit is contained in:
@@ -24,6 +24,8 @@ const { section } = Astro.props;
|
||||
const max = Math.max(...cards.map(c => c.offsetHeight));
|
||||
if (max > 0) cards.forEach(c => (c.style.height = `${max}px`));
|
||||
}
|
||||
equalizeProcessCards();
|
||||
window.addEventListener('resize', equalizeProcessCards);
|
||||
document.fonts.ready.then(() => {
|
||||
equalizeProcessCards();
|
||||
window.addEventListener('resize', equalizeProcessCards);
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user