-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Draft/Experiment: Explore unified placeholders. * Remove comments. * Update label. * Update hover styles. * Update changelog. * Use 2px consistent icons across group and columns * Use : in variation instructions * Add target for hover * Show title. * Initial layout work. * Improve behavior for narrow contexts. * Polish. * Apply margin to Group as well. * Center the buttons when small. * Center upload, 4px padding. * Address feedback (4px gap, justification) * Update embed block. * Fix site logo centering, improve very small contexts. --------- Co-authored-by: Rich Tabor <[email protected]>
- Loading branch information
Showing
14 changed files
with
95 additions
and
232 deletions.
There are no files selected for viewing
94 changes: 22 additions & 72 deletions
94
packages/block-editor/src/components/block-variation-picker/content.scss
This file contains 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 |
---|---|---|
@@ -1,89 +1,39 @@ | ||
.block-editor-block-variation-picker { | ||
.components-placeholder__instructions { | ||
// Defer to vertical margins applied by template picker options. | ||
margin-bottom: 0; | ||
} | ||
|
||
.components-placeholder__fieldset { | ||
// Options will render horizontally, but the immediate children of the | ||
// fieldset are the options and the skip button, oriented vertically. | ||
flex-direction: column; | ||
} | ||
|
||
&.has-many-variations .components-placeholder__fieldset { | ||
// Allow options to occupy a greater amount of the available space if | ||
// many options exist. | ||
max-width: 90%; | ||
} | ||
} | ||
|
||
.block-editor-block-variation-picker__variations.block-editor-block-variation-picker__variations { | ||
.block-editor-block-variation-picker__variations, | ||
.block-editor-block-variation-picker__skip, | ||
.wp-block-group-placeholder__variations { | ||
list-style: none; | ||
display: flex; | ||
justify-content: flex-start; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
width: 100%; | ||
margin: $grid-unit-20 0; | ||
padding: 0; | ||
list-style: none; | ||
margin: 0; | ||
gap: $grid-unit-10; | ||
font-size: $helptext-font-size; | ||
|
||
> li { | ||
list-style: none; | ||
margin: $grid-unit-10 ( $grid-unit-10 + $grid-unit-15 ) 0 0; | ||
flex-shrink: 1; | ||
width: 75px; | ||
text-align: center; | ||
|
||
button { | ||
display: inline-flex; | ||
margin-right: 0; | ||
} | ||
svg { | ||
fill: $gray-400 !important; | ||
} | ||
|
||
.block-editor-block-variation-picker__variation { | ||
padding: $grid-unit-10; | ||
.components-button { | ||
padding: 4px; | ||
} | ||
|
||
.block-editor-block-variation-picker__variation-label { | ||
font-family: $default-font; | ||
font-size: 12px; | ||
display: block; | ||
line-height: 1.4; | ||
.components-button:hover { | ||
background: none !important; // !important to simplify the selector. | ||
} | ||
} | ||
|
||
.block-editor-block-variation-picker__variation { | ||
width: 100%; | ||
|
||
&.components-button.has-icon { | ||
// Override default styles inherited from <Button /> to center | ||
// icon horizontally. | ||
justify-content: center; | ||
width: auto; | ||
|
||
&.is-secondary { | ||
background-color: $white; | ||
} | ||
} | ||
|
||
&.components-button { | ||
// Override default styles inherited from <Button /> to allow button | ||
// to grow vertically. | ||
height: auto; | ||
padding: 0; | ||
} | ||
|
||
&::before { | ||
// Use `padding-bottom` trick to style element as perfect square. | ||
content: ""; | ||
padding-bottom: 100%; | ||
} | ||
|
||
&:first-child { | ||
margin-left: 0; | ||
.components-button:hover svg { | ||
fill: var(--wp-admin-theme-color) !important; | ||
} | ||
|
||
&:last-child { | ||
margin-right: 0; | ||
& > li { | ||
width: auto; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: $grid-unit-05; | ||
} | ||
} | ||
|
This file contains 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 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 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 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 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 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 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
Oops, something went wrong.