Skip to content

Commit

Permalink
Imp: improve gutenberg alignment compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
eri-trabiccolo committed Nov 15, 2018
1 parent 64109d8 commit f3c991e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
3 changes: 3 additions & 0 deletions assets/front/scss/0_3_components/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,9 @@ cite {
color: inherit;
}
}
& > p {
margin-top: 0
}
}
&:not([class*=align]) {
clear: both;
Expand Down
27 changes: 14 additions & 13 deletions assets/front/scss/0_4_layout/_article.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,15 @@ section[class^="post-"] {


// Gutenberg
// cover images */
// video and audio elements
.alignfull,
.alignwide {
&.wp-block-audio audio,
&.wp-block-video video {
width: 100%;
}
}

//
// Real alignfull and alignwide
// allowed only in layouts with no sidebars and full-width
Expand All @@ -192,7 +200,7 @@ section[class^="post-"] {
// only reset the .container[role=main] horizontal padding
// The "cover image" block of the new WP editor has been renamed "cover".
// See https://github.com/WordPress/gutenberg/pull/10659, but posts created with the former cover-image block will still use the wp-block-cover-image css class.
.entry-content .wp-block-cover-image, .entry-content .wp-block-cover {
.entry-content [class*=wp-block-] {
&.alignfull,
&.alignwide {
margin-right: -15px;
Expand All @@ -201,21 +209,13 @@ section[class^="post-"] {
width: auto;
}
}
&.czr-boxed-layout .entry-content .wp-block-cover-image {
@include media-breakpoint-up(sm) {
&.alignfull,
&.alignwide {
margin-right: -30px;
margin-left: -30px;
}
}
}
&.czr-boxed-layout .entry-content .wp-block-cover {
&.czr-boxed-layout .entry-content [class*=wp-block-] {
@include media-breakpoint-up(sm) {
&.alignfull,
&.alignwide {
margin-right: -30px;
margin-left: -30px;
max-width: 100vw;
}
}
}
Expand All @@ -228,7 +228,7 @@ section[class^="post-"] {
// alignfull
// The "cover image" block of the new WP editor has been renamed "cover".
// See https://github.com/WordPress/gutenberg/pull/10659, but posts created with the former cover-image block will still use the wp-block-cover-image css class.
.entry-content .wp-block-cover-image.alignfull, .entry-content .wp-block-cover.alignfull {
.entry-content .alignfull[class*=wp-block-] {
width: 100vw;
max-width: 100vw;
position: relative;
Expand Down Expand Up @@ -513,6 +513,7 @@ section.post-related-articles {
@at-root .related-posts_nav {
margin-top: $base-line-height*4;
.slider-control {
font-family: Helvetica;
width: 3em;
height: 3em;
line-height: 3em;
Expand Down

0 comments on commit f3c991e

Please sign in to comment.