-
Notifications
You must be signed in to change notification settings - Fork 4.9k
ToolsPanel: Migrate styles to an SCSS Module #80445
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
Open
ciampo
wants to merge
5
commits into
trunk
Choose a base branch
from
codex/fix-tools-panel-heading-cascade
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e41d779
ToolsPanel: Preserve heading typography
ciampo 6ba9fb2
Components: Add ToolsPanel changelog entry
ciampo b9c61f9
ToolsPanel: Migrate styles to an SCSS Module
ciampo ae9d7fa
ToolsPanel: Preserve grid spacing from context
ciampo 05e51c1
ToolsPanel: Document Emotion migration
ciampo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| @use "@wordpress/base-styles/colors" as *; | ||
| @use "@wordpress/base-styles/variables" as *; | ||
| @use "../utils/theme-variables" as *; | ||
|
|
||
| .tools-panel { | ||
| border-top: $border-width solid $gray-300; | ||
| margin-top: -$border-width; | ||
| padding: $grid-unit-20; | ||
| } | ||
|
|
||
| .tools-panel-with-inner-wrapper { | ||
| > div:not(:first-of-type) { | ||
| display: grid; | ||
| grid-template-columns: repeat(2, minmax(0, 1fr)); | ||
| column-gap: $grid-unit-20; | ||
| row-gap: $grid-unit-20; | ||
| grid-column: 1 / -1; | ||
| } | ||
| } | ||
|
|
||
| .tools-panel-hidden-inner-wrapper { | ||
| > div:not(:first-of-type) { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| .tools-panel-header { | ||
| grid-column: 1 / -1; | ||
| gap: $grid-unit-10; | ||
|
|
||
| // Targeting DropdownMenu's legacy classes is temporary until it exposes a | ||
| // supported styling hook for these overrides. | ||
| :global(.components-dropdown-menu) { | ||
| margin: (-1 * $grid-unit-05) 0; | ||
| line-height: 0; | ||
| } | ||
| } | ||
|
|
||
| // Match the previous Emotion `&&&&` specificity so these styles continue to | ||
| // override the DropdownMenu toggle defaults. | ||
| .tools-panel-header.tools-panel-header.tools-panel-header.tools-panel-header { | ||
| :global(.components-dropdown-menu__toggle) { | ||
| padding: 0; | ||
| min-width: $grid-unit-30; | ||
| } | ||
| } | ||
|
|
||
| // Outrank Heading's base typography regardless of stylesheet insertion order. | ||
| .tools-panel-heading.tools-panel-heading { | ||
| font-size: inherit; | ||
| font-weight: var(--wpds-typography-font-weight-emphasis); | ||
| line-height: normal; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .tools-panel-item { | ||
| grid-column: 1 / -1; | ||
|
|
||
| // Clear spacing in and around controls added as panel items. Remove these | ||
| // overrides when the spacing can be addressed via the context system. | ||
| & > div, | ||
| & > fieldset { | ||
| padding-bottom: 0; | ||
| margin-bottom: 0; | ||
| max-width: 100%; | ||
| } | ||
| } | ||
|
|
||
| // Match the previous Emotion `&&` specificity and target BaseControl's | ||
| // preserved public class names instead of its generated Emotion classes. | ||
| .tools-panel-item.tools-panel-item :global(.components-base-control) { | ||
| margin-bottom: 0; | ||
|
|
||
| // Keep the field spacing when help text follows it. | ||
| :global(.components-base-control__field):last-child { | ||
| margin-bottom: 0; | ||
| } | ||
| } | ||
|
|
||
| .tools-panel-item :global(.components-base-control__help) { | ||
| margin-bottom: 0; | ||
| } | ||
|
|
||
| .tools-panel-item-placeholder { | ||
| display: none; | ||
| } | ||
|
|
||
| .dropdown-menu { | ||
| min-width: 200px; | ||
| } | ||
|
|
||
| .reset-label { | ||
| color: $components-color-accent-darker-10; | ||
| font-size: var(--wpds-typography-font-size-xs); | ||
| font-weight: var(--wpds-typography-font-weight-emphasis); | ||
| line-height: 1.4; | ||
| /* stylelint-disable-next-line plugin/use-logical-properties-and-values -- Preserve the physical-axis behavior of the previous Emotion `rtl()` styles. */ | ||
| margin-left: $grid-unit-15; | ||
| text-transform: uppercase; | ||
| } | ||
|
|
||
| .reset-label-rtl { | ||
| /* stylelint-disable-next-line plugin/use-logical-properties-and-values -- Preserve the physical-axis behavior of the previous Emotion `rtl()` styles. */ | ||
| margin-left: 0; | ||
| /* stylelint-disable-next-line plugin/use-logical-properties-and-values -- Preserve the physical-axis behavior of the previous Emotion `rtl()` styles. */ | ||
| margin-right: $grid-unit-15; | ||
| } | ||
|
|
||
| .default-controls-item { | ||
| color: $gray-900; | ||
| } | ||
|
|
||
| // Match the previous Emotion `&&` specificity so disabled MenuItem styles | ||
| // continue to override its defaults. | ||
| .default-controls-item.default-controls-item[aria-disabled="true"] { | ||
| color: $gray-700; | ||
| opacity: 1; | ||
|
|
||
| &:hover { | ||
| color: $gray-700; | ||
| } | ||
|
|
||
| .reset-label { | ||
| opacity: 0.3; | ||
| } | ||
| } | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Again, these seem safe and clean enough to address right now.