-
Notifications
You must be signed in to change notification settings - Fork 2k
Hosting Dashboard v2: view transitions (part 1) #103278
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
225746d
c2fc73f
aa9780e
6cdeaaf
70782b6
de3e647
a4329cf
d279d10
1394501
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
::view-transition-old(root), | ||
::view-transition-new(root) { | ||
animation-duration: 250ms; | ||
} | ||
|
||
// The main and sub headers must be separate view transitions, othervise the sub | ||
// header won't slide in! | ||
header.dashboard-header-bar { | ||
view-transition-name: main-header; | ||
} | ||
main div.dashboard-header-bar { | ||
view-transition-name: sub-header; | ||
} | ||
|
||
// Headers should show on top of the rest of the page (important for sticky). | ||
::view-transition-group(main-header), | ||
::view-transition-group(sub-header) { | ||
z-index: 1; | ||
} | ||
|
||
// Do not let the browser transform (slide in) the main hear. This is important | ||
// for sticy positioning (when the page is scrolled down) and gently switching | ||
// between the main and sub headers. | ||
::view-transition-group(main-header) { | ||
transform: none !important; | ||
} | ||
|
||
::view-transition-image-pair(main-header), | ||
::view-transition-image-pair(sub-header) { | ||
height: auto; | ||
} | ||
|
||
// Large and small must be separate so they don't cross-animate. | ||
.dashboard-page-layout.is-large > .dashboard-page-layout__header { | ||
view-transition-name: page-layout-header-large; | ||
} | ||
.dashboard-page-layout.is-small > .dashboard-page-layout__header { | ||
view-transition-name: page-layout-header-small; | ||
} | ||
|
||
.dashboard-page-layout.is-large > .dashboard-page-layout__header .components-button.is-primary { | ||
view-transition-name: page-layout-header-large--button; | ||
} | ||
|
||
::view-transition-old(page-layout-header-large--button), | ||
::view-transition-new(page-layout-header-large--button) { | ||
height: 100%; | ||
} | ||
|
||
.dashboard-page-layout__content { | ||
view-transition-name: page-layout-content; | ||
} | ||
|
||
::view-transition-old(page-layout-content), | ||
::view-transition-new(page-layout-content) { | ||
// Never expand the main content horizontally, but allow it to shrink. | ||
width: auto; | ||
// Also disable shrinking. Leaving it commented out to test. | ||
// max-width: 100%; | ||
height: auto; | ||
} | ||
|
||
::view-transition-image-pair(page-layout-content) { | ||
display: flex; | ||
justify-content: center; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import { __experimentalVStack as VStack } from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
import PageLayout from '../../components/page-layout'; | ||
import RouterLinkSummaryButton from '../../components/router-link-summary-button'; | ||
|
||
function Privacy() { | ||
return ( | ||
<PageLayout | ||
title={ __( 'Privacy' ) } | ||
description={ __( 'Manage your privacy settings.' ) } | ||
size="small" | ||
/> | ||
<PageLayout title={ __( 'Privacy' ) } size="small"> | ||
<VStack spacing={ 4 }> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would we need to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the description is not present in the designs, so I removed it. It's necessary for there to be some content because otherwise the content will slide in (from nothing) instead of cross fade. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we just add a placeholder paragraph then instead of these? Also There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand what you mean. I added the VStack because billing has that too for the summary buttons. Why a paragraph? These should because summary buttons, not paragraphs. |
||
<RouterLinkSummaryButton title={ __( 'Details' ) } to="/me/privacy" /> | ||
</VStack> | ||
</PageLayout> | ||
); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import DataViewsCard from '../../components/dataviews-card'; | ||
import PageLayout from '../../components/page-layout'; | ||
|
||
function SiteDeployments() { | ||
return <PageLayout title={ __( 'Deployments' ) } />; | ||
return ( | ||
<PageLayout title={ __( 'Deployments' ) }> | ||
<DataViewsCard> | ||
<></> | ||
</DataViewsCard> | ||
</PageLayout> | ||
); | ||
} | ||
|
||
export default SiteDeployments; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
import { Card, CardBody } from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
import PageLayout from '../../components/page-layout'; | ||
|
||
function SitePerformance() { | ||
return <PageLayout title={ __( 'Performance' ) } />; | ||
return ( | ||
<PageLayout title={ __( 'Performance' ) }> | ||
<Card> | ||
<CardBody> | ||
<></> | ||
</CardBody> | ||
</Card> | ||
</PageLayout> | ||
); | ||
} | ||
|
||
export default SitePerformance; |
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.
I like that it feels not intrusive like that. It's its own CSS file that we can remove and iterate on as needed. I don't like that we have to use classnames for things that are rendered in different places to achieve it though.
I'm not sure yet what's the best approach.