-
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
Aligments: explore idea on image block #20656
Changes from all commits
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 |
---|---|---|
|
@@ -104,13 +104,56 @@ body.block-editor-page { | |
.wp-block { | ||
max-width: $content-width; | ||
|
||
&[data-align="wide"], | ||
&.alignwide { | ||
&[data-align="wide"] { | ||
max-width: 1100px; | ||
} | ||
|
||
&[data-align="full"], | ||
&.alignfull { | ||
&[data-align="full"] { | ||
max-width: none; | ||
} | ||
} | ||
|
||
.wp-align-wrapper { | ||
max-width: $content-width; | ||
margin-left: auto; | ||
margin-right: auto; | ||
|
||
> .wp-block, | ||
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 this? 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. Because the max-width should apply to the align wrapper, but not the nested block |
||
&.wp-align-full { | ||
max-width: none; | ||
} | ||
|
||
&.wp-align-full { | ||
margin-left: -$block-padding; | ||
margin-right: -$block-padding; | ||
|
||
@include break-small() { | ||
margin-left: -$block-padding - $block-padding - $block-side-ui-width - $border-width - $border-width; | ||
margin-right: -$block-padding - $block-padding - $block-side-ui-width - $border-width - $border-width; | ||
} | ||
} | ||
|
||
&.wp-align-wide { | ||
max-width: 1100px; | ||
} | ||
|
||
&.wp-align-left > * { | ||
float: left; | ||
margin-right: 2em; | ||
} | ||
|
||
&.wp-align-right > * { | ||
float: right; | ||
margin-left: 2em; | ||
} | ||
|
||
&.wp-align-left > *, | ||
&.wp-align-right > * { | ||
// Without z-index, won't be clickable as "above" adjacent content. | ||
z-index: z-index(".block-editor-block-list__block {core/image aligned left or right}"); | ||
} | ||
|
||
&.wp-align-center { | ||
// Same as no alignment? | ||
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. this needs display: flex and justify-content center for me. 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. you should be able to see the difference between "center" and "no" when you resize an image smaller than the $content-width 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. display: flex has the unfortunate side effect of not collapsing margins. :) I'll figure it out though. |
||
} | ||
} |
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.
we're having
wp-align-undefined
sometimes