-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Global Styles Sidebar: tweak separator margin #40526
Changes from 1 commit
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 |
---|---|---|
|
@@ -136,3 +136,10 @@ $split-border-control-offset: 55px; | |
} | ||
} | ||
} | ||
|
||
// Override the `hr` styles defined for the complementary area component | ||
// from the `@wordpress/interface` package. | ||
.edit-site-global-styles-sidebar hr { | ||
margin: 0; | ||
border-color: rgba(0, 0, 0, 0.1); | ||
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 do we need to override the if it's mainly the margin that need zeroing out? While diving in here, I also noticed that the previous color is wrong. It outputs #f0f0f0 (which maps to $gray-100), but it should have been #e0e0e0 ($gray-200) like the other panel borders. Depending on your thoughts here (maybe there's a reason you used opacity), I could imagine two paths forward:
What do you think? 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 separator in the Global Styles sidebar is rendered as a The style overrides introduced by
I will go ahead and drop this color override from this PR. As for the next steps, there will be a few separate fronts to work on:
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. Ah, excellent context. It does sound like we'll want to fix that at the component level. At the moment we have these shades of gray for most of the UI:
In this case, the 0.1 opacity divider actually matches I understand there are challenges with making the components work on a dark background, and that it can therefore make sense to use more agnostic colors that aren't optimized for a white background, perhaps even opacities. I trust that'll be taken into account 👍 👍
ciampo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
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.
Short and sweet. Is this meant to be a temporary override to a point where the HR can be customized on the component level? If yes, then we might want to add a comment to that effect.
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.
Not really — the Global Styles Sidebar is already using
CardDivider
for this separator. The issue is that the sidebar internally uses a component from the@wordpress/interface
package calledComplementaryArea
, which introduces some style overrides, including this one on all its childrenhr
.A few solutions that come to mind:
CardDivider
styles, so that they would not get overridden by the styles ofComplementaryArea
— although I wouldn't recommend going down this route, it's a hacky approach that can cause a "race for specificity" in other parts of the repo;ComplementaryArea
, although it may be a difficult task given how widespread the usage ofComplementaryArea
may be.Basically, the problem is that separators under
ComplementaryArea
are not encapsulated components, but are instead styles with some "global" css.