-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Extract the three color panels to their own global styles view #35400
Conversation
|
||
export default function ColorPanel( { name } ) { | ||
function ScreenBackgroundColor( { name } ) { |
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 have considered merging the three screens (background, text and link) into a single screen with a colorType
prop to change its behavior but the code felt less readable and full with if/else. So I thought for now it's better to have separate screen (even with some code duplication).
import { getSupportedGlobalStylesPanels, useStyle } from './hooks'; | ||
import Subtitle from './subtitle'; | ||
|
||
function BackgroundColorItem( { name, parentMenu } ) { |
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 have considered merging the three items (background, text and link) into a single component with a colorType
prop to change its behavior but the code felt less readable and full with if/else. So I thought for now it's better to have separate screen (even with some code duplication).
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.
This seems fine to me. We might want to create a "BlockElement" higher level component eventually, but we need to see how the typography ones evolve, and how we want to render this in the block inspector where it doesn't "navigate".
Size Change: +360 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
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.
This is working well for me.
packages/edit-site/src/components/global-styles/screen-colors.js
Outdated
Show resolved
Hide resolved
c7ac256
to
8b277a8
Compare
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.
Sorry if I'm a bit late to review this, I had a lot to catch up this week.
In general, it'd be great if we could slowly chip away at packages/edit-site/src/components/global-styles/style.scss
by leveraging the components directly, until we don't need those styles at all.
.edit-site-global-styles-subtitle { | ||
// Need to override the too specific styles for complementary areas. | ||
margin-bottom: 0 !important; | ||
text-transform: uppercase; | ||
font-weight: 500; | ||
} |
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.
Is this a sign that the Heading
component is not fitting our design needs at the moment?
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.
potentially, I'm not sure if this uppercased heading is something that is already available and part of the "style guide"
Builds on top of #35264
Related to #34574
This PR extract the different color configurations into their own separate view and adds a group item to navigate to each one of them, like suggested in #34574
This PR doesn't update the design of the content of these views directly, they're still using the old color components for now.
Testing instructions