-
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
Address "wide" alignment programatically #812
Changes from 11 commits
549228d
9968972
4d68c23
e641ccb
274b0fa
7325ba3
662aab6
8f138a8
aaeb881
b7888a8
5e999c9
a4d712e
3c883b7
9ea3743
1923ade
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 |
---|---|---|
|
@@ -9,17 +9,28 @@ | |
&[data-align="left"] { | ||
float: left; | ||
margin-right: $block-padding; | ||
@include break-medium() { | ||
margin-left: calc( 50% - #{ $visual-editor-max-width / 2 } ); | ||
} | ||
} | ||
|
||
&[data-align="right"] { | ||
float: right; | ||
margin-left: $block-padding; | ||
@include break-medium() { | ||
margin-right: calc( 50% - #{ $visual-editor-max-width / 2 } ); | ||
} | ||
} | ||
|
||
&[data-align="wide"] { | ||
max-width: 1100px; | ||
} | ||
|
||
&[data-align="full"] { | ||
max-width: 100%; | ||
padding-left: 0; | ||
padding-right: 0; | ||
margin-right: -#{ $block-padding + $block-mover-margin }; /* Compensate for .editor-visual-editor centering padding */ | ||
box-sizing: border-box; | ||
|
||
&:before { | ||
left: 0; | ||
|
@@ -30,13 +41,39 @@ | |
.editor-block-mover { | ||
display: none; | ||
} | ||
} | ||
|
||
&[data-align="full"], | ||
&[data-align="wide"] { | ||
.editor-visual-editor__block-controls { | ||
max-width: #{ $visual-editor-max-width - $block-padding - ( $block-padding * 2 + $block-mover-margin ) }; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
max-width: $visual-editor-max-width - ( ( $block-padding + $block-padding + $block-mover-margin ) * 2 );; | ||
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. Double semi-colon ending. 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. Should we move following comments before the 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. 👍 I think the max-width was removed just now. |
||
// a block is 600px wide inside a 700px container | ||
// with block mover margin, border widths and paddings, toolbars are indented 46px | ||
// that's 2px border plus 10px padding plus 18px mover margin | ||
// these 46px are accounted for on both sides, to make sure the block is centered | ||
|
||
width: auto; | ||
margin-left: $block-mover-padding-hidden + $block-padding; | ||
margin-right: $block-mover-padding-hidden + $block-padding; | ||
|
||
@include break-small() { | ||
width: 100%; | ||
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 position of the controls isn't quite right when at wide or full alignments. You can see it move left and right when toggling between an image "Align left" and "Align wide". I think we need to assign 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. 👍 |
||
margin-left: auto; | ||
margin-right: auto; | ||
|
||
.is-sidebar-opened & { | ||
padding-left: $block-mover-padding-visible + $block-padding; | ||
padding-right: $block-mover-padding-visible + $block-padding; | ||
} | ||
} | ||
|
||
@include break-large() { | ||
.is-sidebar-opened & { | ||
padding-left: 0; | ||
padding-right: 0; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
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.
Shouldn't need this:
https://github.com/WordPress/gutenberg/blob/73bd4ab/editor/assets/stylesheets/main.scss#L17-L20
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.
👍