Skip to content
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

feat: add support for view transitions #902

Closed
wants to merge 1 commit into from
Closed

feat: add support for view transitions #902

wants to merge 1 commit into from

Conversation

rishi-raj-jain
Copy link

@rishi-raj-jain rishi-raj-jain commented Oct 14, 2023

What kind of changes does this PR include?

  • Changes to Starlight code

Description

  • What does this PR change? Give us a brief description.

Adds view transitions.

@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2023

🦋 Changeset detected

Latest commit: 6f8351b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Oct 14, 2023

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 6f8351b
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/652adb5e8c0588000871cc07
😎 Deploy Preview https://deploy-preview-902--astro-starlight.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 github-actions bot added the 🌟 core Changes to Starlight’s main package label Oct 14, 2023
@rishi-raj-jain rishi-raj-jain changed the title view transitions feat: enable view transitions Oct 14, 2023
@rishi-raj-jain rishi-raj-jain changed the title feat: enable view transitions feat: add support for view transitions Oct 14, 2023
Copy link
Member

@HiDeoo HiDeoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

I am not sure to understand how to test this change. The PR adds a new viewTransitions Starlight configuration option (defined in your astro.config.mjs file) in the UserConfigSchema but reads the viewTransitions frontmatter field of a page from Astro.props.entry.data so I don't see how to enable the new option.

There may be something to fix here to either always use a frontmatter field (packages/starlight/schema.ts) or always use a Starlight configuration option (packages/starlight/utils/user-config.ts), or both?

If we were to provide a new convenience option to enable view transitions (it is already possible to use view transitions using component overrides), I think there might also be some other considerations to discuss/take into account:

  • Should this option be overridable on a per-page basis through frontmatter too?
  • Should we include an option to easily set transition:animate="none" on the page’s <html> element too? Having full control over your page animation on specific elements is a powerful feature but having an option to quickly enable view transitions and having to rely on component overrides to disable them for the rest of the page feels a bit weird (considering that adding an attribute to html is not the easiest thing to do with component overrides).

@delucis
Copy link
Member

delucis commented Oct 24, 2023

This is also a duplicate of #694, so we can probably close and discuss there.

@delucis delucis closed this Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants