Skip to content

Conversation

@anh-ld
Copy link

@anh-ld anh-ld commented Oct 15, 2023

What kind of changes does this PR include?

  • Reduce initial CSS load from 10.5KB to 7.9KB by lazy loading @pagefind/default-ui/css/ui.css and its customized CSS.

Description

  • I moved the @pagefind/default-ui/css/ui.css and the Search.astro's <style is:global> into styles/search.css and then lazy load the styles/search.css onIdle.

@netlify
Copy link

netlify bot commented Oct 15, 2023

Deploy Preview for astro-theme-cactus ready!

Name Link
🔨 Latest commit 1e02dec
🔍 Latest deploy log https://app.netlify.com/sites/astro-theme-cactus/deploys/6568a97c9d591c00086b05be
😎 Deploy Preview https://deploy-preview-145--astro-theme-cactus.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@chrismwilliams
Copy link
Owner

chrismwilliams commented Dec 1, 2023

Thanks for opening this and for taking the time to do this.

I appreciate the savings, but I'm not sure if this will trip some people up with View Transitions, it would require testing to make sure it's compatible as I've had some issue's with it already and ended up removing it.

There's also caching with the styles being in a .js file, and with the possibility of people clicking search before the styles have been processed.

What I can do is put a link in the README to your request as a possible solution to reduce initial load.

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

Successfully merging this pull request may close these issues.

2 participants