-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
clarify astro:before-swap example [i18nIgnore] #12254
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
clarify astro:before-swap example [i18nIgnore] #12254
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌑 This pull request will not trigger status changes. Learn moreLunaria automatically ignores changes on specific PRs by adding a ignored keyword in its title. Found: You can change this by either removing the keyword above from the PR's title, or modifying the Tracked FilesNote The notes below indicate what would happen if the pull request is merged when triggering status changes. Since a ignored keyword was found in the PR's title, the status changes indicated below won't be applied.
Warnings reference
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
@martrapp |
oh my bad, I should have update it in all languages |
Synced the change across all languages where it was used, and noticed this page isn’t available in Arabic. I’ll contribute by helping with the Arabic translation. |
Added |
Thank you @yanthomasdev! I had no idea how to handle multi-language PRs 😌 |
@yanthomasdev, Lunaria flagged 6 languages in its comment above. |
Thank you for this PR, @sharqawycs! <script>
document.addEventListener("astro:before-swap", (event) => {
event.newDocument.documentElement.dataset.theme =
localStorage.getItem("darkMode") ? "dark" : "light";
});
</script> |
…view transation code example
…astro:before-swap view transation code example
Thanks for your guidance again, @martrapp, a line break would be helpful and more accessible. |
@martrapp yes, the Lunaria action only shows changed files, so that's expected. |
Great, @sharqawycs! Do you want to change the |
I just have changed the |
Yes, but I thought it has the same code under after:swap? |
I searched the file and have not find the targeted block of code. If you could find it, you can modify it |
😄 you already changed and included the |
Ah, my bad, I all messed up! |
Sorry for the confusion. so the Again, thank you very much, @sharqawycs, for helping to improve the docs! |
No worries, languages names are quite confusing |
Yes I am there, my username is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Thanks a lot!
Description (required)
closes #12253
Uses the correct
localStorage.getItem()
.Simplifies the
astro:before-swap
example in view-transitions to make it clearer and focused on the swap only.Removes
is:inline
and extra helper functions so readers can see the minimal working example.Old example:
Updated example:
discord: @sharqawycs