-
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.
Block editor: Extract BLockPatternPicker component
- Loading branch information
Showing
10 changed files
with
129 additions
and
126 deletions.
There are no files selected for viewing
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
74 changes: 74 additions & 0 deletions
74
packages/block-editor/src/components/block-pattern-picker/style.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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.block-editor-block-pattern-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-patterns .components-placeholder__fieldset { | ||
// Allow options to occupy a greater amount of the available space if | ||
// many options exist. | ||
max-width: 90%; | ||
} | ||
} | ||
|
||
.block-editor-block-pattern-picker__patterns.block-editor-block-pattern-picker__patterns { | ||
display: flex; | ||
justify-content: center; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
width: 100%; | ||
margin: $grid-size-small 0; | ||
list-style: none; | ||
|
||
> li { | ||
list-style: none; | ||
margin: $grid-size; | ||
flex-shrink: 1; | ||
max-width: 100px; | ||
} | ||
|
||
.block-editor-block-pattern-picker__pattern { | ||
padding: $grid-size; | ||
} | ||
} | ||
|
||
.block-editor-block-pattern-picker__pattern { | ||
width: 100%; | ||
|
||
&.components-icon-button { | ||
// Override default styles inherited from <IconButton /> to center | ||
// icon horizontally. | ||
justify-content: center; | ||
|
||
&.is-default { | ||
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; | ||
} | ||
|
||
&:last-child { | ||
margin-right: 0; | ||
} | ||
} |
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
Empty file.