Repository navigation
Boot, Site Editor: Seed content surfaces with default background color #81646
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
Changes from 15 commits
f90ba85
0a62071
f4d2ff2
91d37fc
9873f95
eca7f15
4dbb1f9
37966aa
ef2aa2b
b3dcbd5
34b5745
ef881ba
64396bc
ddbc822
8cacba5
a49f006
08fa66b
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 |
|---|---|---|
|
|
@@ -161,7 +161,8 @@ export default function Root() { | |
| <ThemeProvider | ||
| color={ { | ||
| ...themeColors, | ||
| background: '#ffffff', | ||
| // Reset to the default background color. | ||
| background: '#fcfcfc', | ||
|
Member
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. Rather than hard-code this to
Member
Author
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, @ciampo and I have been considering this as a possible approach. Though, it isn't straightforward when you consider the dark mode case. Many possible ways to approach.
Contributor
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. Maybe extracting those values to local const called
Member
Author
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. Added inline comments for clarity. |
||
| } } | ||
| > | ||
| <Outlet /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,12 @@ | |
| } | ||
| } | ||
|
|
||
| .edit-site-styles__content { | ||
| flex-grow: 1; | ||
| min-height: 0; | ||
| background-color: var(--wpds-color-background-surface-neutral-strong); | ||
|
Member
Author
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. |
||
| } | ||
|
|
||
| // Show button text labels when preference is enabled. | ||
| .show-icon-labels { | ||
| .edit-site-styles__header-actions { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .edit-site-sidebar-identity__form { | ||
| flex-grow: 1; | ||
| min-height: 0; | ||
| background-color: var(--wpds-color-background-surface-neutral-strong); | ||
|
Member
Author
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. |
||
| padding: var(--wpds-dimension-padding-lg) var(--wpds-dimension-padding-2xl); | ||
|
Member
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'm not sure I understand why we removed
Member
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. Oh, I suppose it's so that the padded part follows the background color 🤔 Abstraction piercing / duplicated source of truth concern still applies. Another thought is to allow Page to accept a prop to apply a class name to the content area, but that could be messy.
Contributor
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. This is potentially a regression. Removing
Member
Author
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. |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,35 +67,37 @@ function FontLibraryPage() { | |
|
|
||
| return ( | ||
| <Page title={ __( 'Fonts' ) } className="font-library-page"> | ||
| <Tabs | ||
| selectedTabId={ activeTab } | ||
| onSelect={ ( tabId: string ) => setActiveTab( tabId ) } | ||
| > | ||
| <div className="font-library-page__tablist"> | ||
| <Tabs.TabList> | ||
| { tabs.map( ( { id, title } ) => ( | ||
| <Tabs.Tab key={ id } tabId={ id }> | ||
| { title } | ||
| </Tabs.Tab> | ||
| ) ) } | ||
| </Tabs.TabList> | ||
| </div> | ||
| { tabs.map( ( { id } ) => ( | ||
| <Tabs.TabPanel | ||
| key={ id } | ||
| tabId={ id } | ||
| focusable={ false } | ||
| className="font-library-page__tab-panel" | ||
| > | ||
| <FontLibrary | ||
| value={ user } | ||
| baseValue={ base } | ||
| onChange={ setUser } | ||
| activeTab={ id } | ||
| /> | ||
| </Tabs.TabPanel> | ||
| ) ) } | ||
| </Tabs> | ||
| <div className="font-library-page__content"> | ||
|
Contributor
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. Previously, tab list and panel were direct flex children of The new content wrapper already occupies only the space below the Page header, but In practical terms, this means that the header is now subtracted twice, leaving leaves about one header's worth of unused space and making the font list scroll sooner.
Member
Author
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. |
||
| <Tabs | ||
| selectedTabId={ activeTab } | ||
| onSelect={ ( tabId: string ) => setActiveTab( tabId ) } | ||
| > | ||
| <div className="font-library-page__tablist"> | ||
| <Tabs.TabList> | ||
| { tabs.map( ( { id, title } ) => ( | ||
| <Tabs.Tab key={ id } tabId={ id }> | ||
| { title } | ||
| </Tabs.Tab> | ||
| ) ) } | ||
| </Tabs.TabList> | ||
| </div> | ||
| { tabs.map( ( { id } ) => ( | ||
| <Tabs.TabPanel | ||
| key={ id } | ||
| tabId={ id } | ||
| focusable={ false } | ||
| className="font-library-page__tab-panel" | ||
| > | ||
| <FontLibrary | ||
| value={ user } | ||
| baseValue={ base } | ||
| onChange={ setUser } | ||
| activeTab={ id } | ||
| /> | ||
| </Tabs.TabPanel> | ||
| ) ) } | ||
| </Tabs> | ||
| </div> | ||
| </Page> | ||
| ); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,12 @@ | |
| @use "@wordpress/base-styles/colors" as *; | ||
| @use "@wordpress/global-styles-ui/build-style/style.css" as *; | ||
|
|
||
| .font-library-page__content { | ||
| flex-grow: 1; | ||
| min-height: 0; | ||
| background-color: var(--wpds-color-background-surface-neutral-strong); | ||
|
Member
Author
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. |
||
| } | ||
|
|
||
| .font-library-page__tablist { | ||
| border-bottom: 1px solid $gray-100; | ||
| padding: 0 $grid-unit-30; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .form { | ||
| flex-grow: 1; | ||
| min-height: 0; | ||
| background-color: var(--wpds-color-background-surface-neutral-strong); | ||
|
Member
Author
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. |
||
| padding: var(--wpds-dimension-padding-lg) var(--wpds-dimension-padding-2xl); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| flex: 1; | ||
| min-height: 0; | ||
| overflow: hidden; | ||
| background-color: var(--wpds-color-background-surface-neutral-strong); | ||
|
Member
Author
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. |
||
|
|
||
| // The page has no footer under the editor, so the body would otherwise | ||
| // run to the bottom edge. Scoped to the route: the modal has its own | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .content { | ||
| flex-grow: 1; | ||
| min-height: 0; | ||
| background-color: var(--wpds-color-background-surface-neutral-strong); | ||
|
Member
Author
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. |
||
| padding: var(--wpds-dimension-padding-lg) var(--wpds-dimension-padding-2xl); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,3 +17,9 @@ | |
| } | ||
| } | ||
|
|
||
| .routes-styles__content { | ||
| flex-grow: 1; | ||
| min-height: 0; | ||
| background-color: var(--wpds-color-background-surface-neutral-strong); | ||
|
Member
Author
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. |
||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ | |
| padding: var(--wpds-dimension-padding-xs) var(--wpds-dimension-padding-sm); | ||
| border: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral-weak); | ||
| border-radius: var(--wpds-border-radius-lg); | ||
| background: var(--wpds-color-background-surface-neutral); | ||
| background: var(--wpds-color-background-surface-neutral-strong); | ||
|
Member
Author
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. |
||
| } | ||
|
|
||
| .url-favicon { | ||
|
|
||


















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.
Now that we correct the theme background seed to the correct default for light mode, I'm seeing these kinds cases where the
Pagecomponent is used with the assumption that the background would be pure white (but no longer is because the token is now correctly resolving to light gray):@ciampo @simison @retrofox Any preferences on how this should be handled? It can either be supported by the
Pagecomponent itself, or handled by the consumer by setting its own background. These cases withDataViewsis kind of already doing this:This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
@ciampo and I discussed this today, and decided that we'll escalate the
Pageproblem to our designers this week.Since that will take some time to reach a solution on, and the problem in this PR is something that should be fixed ASAP, I'll add local background colors for now so we can get this merged.
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.
In discussion with @jasmussen and @simison, we decided that a white background is valid as a pattern, and implementation-wise the consumer will be responsible for setting the background color on their own container if they want white.
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.
How should (we recommend that) they do it?
An explicit prop on page to switch bg variants? Style overrides using the appropriate token?
ThemeProviderwith background seed color set to#fff?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.
What I understood from the discussion was that call sites are expected to put in their own content wrappers. In practice, that involved three CSS rules minimum, plus padding as desired by the use case. (See "white wrapper" changes in this PR.)
I think it's within the range of acceptable (ergonomics/consistency), at least in the near term. But I would still consider it a possibility that we support white backgrounds at the
Pagecomponent level. That decision should be made separately from this PR, which should be merged ASAP.