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

Support for view transition directives #832

Merged
merged 10 commits into from
Jul 19, 2023
Merged

Support for view transition directives #832

merged 10 commits into from
Jul 19, 2023

Conversation

matthewp
Copy link
Contributor

Changes

  • transition:animate on an element is turned into data-astro-transition-scope={renderTransition()} which is used to create a scope name for the particular element and set up the CSS.
  • Automatically includes the View transition CSS if one of the directives are used.

Testing

  • Testing all done in core for now

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Jul 17, 2023

🦋 Changeset detected

Latest commit: 49eea26

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

This PR includes changesets to release 1 package
Name Type
@astrojs/compiler Minor

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

internal/printer/printer.go Outdated Show resolved Hide resolved
internal/printer/printer.go Show resolved Hide resolved
@@ -141,6 +147,10 @@ func (p *printer) printCSSImports(cssLen int) {
p.print(fmt.Sprintf("import \"%s?astro&type=style&index=%v&lang.css\";", p.opts.Filename, i))
i++
}
if p.needsTransitionCSS {
p.addNilSourceMapping()
p.print(`import "astro/components/viewtransitions.css";`)
Copy link
Member

Choose a reason for hiding this comment

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

I didn't clearly comment this yesterday, I was also wondering if we should create a new option for this import path, similar to how we have the internalURL option.

Not blocking as this is experimental and we can change again if we want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, I can add that, good call.

Copy link
Member

Choose a reason for hiding this comment

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

Awesome. Do we also want to prefix with "experimental"? (just in case)

@matthewp matthewp merged commit 2906df2 into main Jul 19, 2023
5 checks passed
@matthewp matthewp deleted the view-transitions branch July 19, 2023 17:15
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