Make WordPress Core

Changeset 44371 for trunk


Ignore:
Timestamp:
12/28/2018 09:21:48 PM (7 years ago)
Author:
laurelfulford
Message:

Twenty Nineteen: Push right-aligned image block outside of text column.

Update right-aligned image block styles to push them outside of the text column on the front end, to match the original design and how the block looks in the editor.

Props kjellr, joen, allancole.
Fixes #45716.

Location:
trunk/src/wp-content/themes/twentynineteen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss

    r44370 r44371  
    506506    //! Image
    507507    .wp-block-image {
     508        max-width: 100%;
    508509
    509510        img {
     
    511512        }
    512513
    513         &.alignleft,
    514         &.alignright {
    515             max-width: 100%;
     514        .aligncenter {
     515           
     516            @include postContentMaxWidth();
     517
     518            @include media(tablet) {
     519                margin: 0;
     520                width: $size__site-tablet-content;
     521
     522                img {
     523                    margin: 0 auto;
     524                }
     525            }
     526
     527            @include media(desktop) {
     528                width: $size__site-desktop-content;
     529
     530                img {
     531                    margin: 0 auto;
     532                }
     533            }
    516534        }
    517535
    518536        &.alignfull img {
    519537            width: 100vw;
     538            max-width: calc( 100% + (2 * #{$size__spacing-unit}));
    520539
    521540            @include media(tablet) {
     541                max-width: calc( 125% + 150px );
    522542                margin-left: auto;
    523543                margin-right: auto;
  • trunk/src/wp-content/themes/twentynineteen/style-rtl.css

    r44370 r44371  
    39453945}
    39463946
     3947.entry .entry-content .wp-block-image {
     3948  max-width: 100%;
     3949}
     3950
    39473951.entry .entry-content .wp-block-image img {
    39483952  display: block;
    39493953}
    39503954
    3951 .entry .entry-content .wp-block-image.alignleft, .entry .entry-content .wp-block-image.alignright {
    3952   max-width: 100%;
     3955@media only screen and (min-width: 768px) {
     3956  .entry .entry-content .wp-block-image .aligncenter {
     3957    max-width: calc(8 * (100vw / 12) - 28px);
     3958  }
     3959}
     3960
     3961@media only screen and (min-width: 1168px) {
     3962  .entry .entry-content .wp-block-image .aligncenter {
     3963    max-width: calc(6 * (100vw / 12) - 28px);
     3964  }
     3965}
     3966
     3967@media only screen and (min-width: 768px) {
     3968  .entry .entry-content .wp-block-image .aligncenter {
     3969    margin: 0;
     3970    width: calc(8 * (100vw / 12) - 28px);
     3971  }
     3972  .entry .entry-content .wp-block-image .aligncenter img {
     3973    margin: 0 auto;
     3974  }
     3975}
     3976
     3977@media only screen and (min-width: 1168px) {
     3978  .entry .entry-content .wp-block-image .aligncenter {
     3979    width: calc(6 * (100vw / 12) - 28px);
     3980  }
     3981  .entry .entry-content .wp-block-image .aligncenter img {
     3982    margin: 0 auto;
     3983  }
    39533984}
    39543985
    39553986.entry .entry-content .wp-block-image.alignfull img {
    39563987  width: 100vw;
     3988  max-width: calc( 100% + (2 * 1rem));
    39573989}
    39583990
    39593991@media only screen and (min-width: 768px) {
    39603992  .entry .entry-content .wp-block-image.alignfull img {
     3993    max-width: calc( 125% + 150px);
    39613994    margin-right: auto;
    39623995    margin-left: auto;
  • trunk/src/wp-content/themes/twentynineteen/style.css

    r44370 r44371  
    39573957}
    39583958
     3959.entry .entry-content .wp-block-image {
     3960  max-width: 100%;
     3961}
     3962
    39593963.entry .entry-content .wp-block-image img {
    39603964  display: block;
    39613965}
    39623966
    3963 .entry .entry-content .wp-block-image.alignleft, .entry .entry-content .wp-block-image.alignright {
    3964   max-width: 100%;
     3967@media only screen and (min-width: 768px) {
     3968  .entry .entry-content .wp-block-image .aligncenter {
     3969    max-width: calc(8 * (100vw / 12) - 28px);
     3970  }
     3971}
     3972
     3973@media only screen and (min-width: 1168px) {
     3974  .entry .entry-content .wp-block-image .aligncenter {
     3975    max-width: calc(6 * (100vw / 12) - 28px);
     3976  }
     3977}
     3978
     3979@media only screen and (min-width: 768px) {
     3980  .entry .entry-content .wp-block-image .aligncenter {
     3981    margin: 0;
     3982    width: calc(8 * (100vw / 12) - 28px);
     3983  }
     3984  .entry .entry-content .wp-block-image .aligncenter img {
     3985    margin: 0 auto;
     3986  }
     3987}
     3988
     3989@media only screen and (min-width: 1168px) {
     3990  .entry .entry-content .wp-block-image .aligncenter {
     3991    width: calc(6 * (100vw / 12) - 28px);
     3992  }
     3993  .entry .entry-content .wp-block-image .aligncenter img {
     3994    margin: 0 auto;
     3995  }
    39653996}
    39663997
    39673998.entry .entry-content .wp-block-image.alignfull img {
    39683999  width: 100vw;
     4000  max-width: calc( 100% + (2 * 1rem));
    39694001}
    39704002
    39714003@media only screen and (min-width: 768px) {
    39724004  .entry .entry-content .wp-block-image.alignfull img {
     4005    max-width: calc( 125% + 150px);
    39734006    margin-left: auto;
    39744007    margin-right: auto;
Note: See TracChangeset for help on using the changeset viewer.