Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion blocks/library/image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ registerBlock( 'core/image', {
title: wp.i18n.__( 'No alignment' ),
isActive: ( { align } ) => ! align || 'none' === align,
onClick: applyOrUnset( 'none' )
},
{
icon: 'align-full-width',
title: wp.i18n.__( 'Wide width' ),
isActive: ( { align } ) => 'wide' === align,
onClick: applyOrUnset( 'wide' )
}
],

getEditWrapperProps( attributes ) {
const { align } = attributes;
if ( 'left' === align || 'right' === align ) {
if ( 'left' === align || 'right' === align || 'wide' === align ) {
return { 'data-align': align };
}
},
Expand Down
65 changes: 65 additions & 0 deletions blocks/library/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,77 @@
float: right;
margin-left: 15px;
}

&[data-align="wide"] {
// Here be dragons...
//
// Variable offsets:
// - Left sidebar
// - Hidden at small viewports
// - Foldable
// - Expanded at medium and above
// - Post settings
// - Collapsed
// - Expanded

left: 50%;
right: 50%;
margin-left: -50vw;
margin-right: -50vw;
width: 100vw;
padding-left: 0;
padding-right: 0;
max-width: none;

.editor-layout.is-sidebar-opened & {
margin-left: calc( -50vw + #{ $sidebar-width / 2 } );
margin-right: calc( -50vw + #{ $sidebar-width / 2 } );
width: calc( 100vw - #{ $sidebar-width } );
}

@include break-medium() {
margin-left: calc( -50vw + 80px );
margin-right: calc( -50vw + 80px );
width: calc( 100vw - 160px );

.auto-fold &,
.folded & {
margin-left: calc( -50vw + 18px );
margin-right: calc( -50vw + 18px );
width: calc( 100vw - 36px );
}

.editor-layout.is-sidebar-opened & {
margin-left: calc( -50vw + 80px + #{ $sidebar-width / 2 } );
margin-right: calc( -50vw + 80px + #{ $sidebar-width / 2 } );
width: calc( 100vw - 160px - #{ $sidebar-width } );

.auto-fold &,
.folded & {
margin-left: calc( -50vw + 18px + #{ $sidebar-width / 2 } );
margin-right: calc( -50vw + 18px + #{ $sidebar-width / 2 } );
width: calc( 100vw - 36px - #{ $sidebar-width } );
}
}
}

&:before {
left: 0;
border-left-width: 0;
border-right-width: 0;
}

.editor-block-mover {
display: none;
}
}
}

.blocks-image {
margin: 0;

img {
display: block;
width: 100%;
}
}
8 changes: 6 additions & 2 deletions editor/layout/style.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.editor-layout.is-sidebar-opened .editor-layout__content {
margin-right: $sidebar-width;
.editor-layout__content {
overflow: hidden;

.editor-layout.is-sidebar-opened & {
margin-right: $sidebar-width;
}
}
7 changes: 3 additions & 4 deletions editor/modes/visual-editor/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.editor-visual-editor {
margin: 60px auto 0;
width: 700px;
max-width: 700px;

&,
& p {
Expand All @@ -12,10 +12,9 @@

.editor-visual-editor__block {
position: relative;
border: 2px solid transparent;
transition: 0.2s border-color;
margin-left: -35px;
left: -35px;
padding: 15px 15px 15px 50px;
transition: 0.2s border-color;

&:before {
z-index: -1;
Expand Down
6 changes: 5 additions & 1 deletion languages/gutenberg.pot
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ msgid "Embed"
msgstr ""

#: blocks/library/embed/index.js:33
#: blocks/library/image/index.js:81
#: blocks/library/image/index.js:87
msgid "Write caption…"
msgstr ""

Expand All @@ -70,6 +70,10 @@ msgstr ""
msgid "No alignment"
msgstr ""

#: blocks/library/image/index.js:65
msgid "Wide width"
msgstr ""

#: blocks/library/list/index.js:11
msgid "List"
msgstr ""
Expand Down