Skip to content
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

Gutenberg - Classes wp-block-image alignfull not respected #354

Open
Bowriverstudio opened this issue Dec 3, 2018 · 6 comments
Open

Gutenberg - Classes wp-block-image alignfull not respected #354

Bowriverstudio opened this issue Dec 3, 2018 · 6 comments

Comments

@Bowriverstudio
Copy link

The css classes wp-block-image alignfull are not aligning full.

For example the image:
This link (for now) is just an empty default child theme of getbeans - with the gutenberg plugin
http://beanssandbox.devbrs.com/

The section "Media Rich" the full width images are not being respected.

I'd expect it to look like: https://weavertheme.com/welcome-to-the-gutenberg-editor/

download
download-1

@Tsquare17
Copy link
Member

I've started looking into this, and added what I thought would fix the issue:

.wp-block-cover-image.alignfull,
.wp-block-gallery.alignfull,
.wp-block-image.alignfull img {
    clear: both;
    left: 50%;
    margin-left: ~"calc(50% - 50vw)";
    margin-right: ~"calc(50% - 50vw)";
    right: 50%;
    width: 100vw;
}

But it doesn't seem to be pulling the correct distance on margin-left.
screenshot from 2018-12-08 15-10-32

@christophherr Any idea what might be causing this?

@christophherr
Copy link
Member

@Tsquare17
We're not declaring any of the "Gutenberg theme supports".
For wide and full images we have to add
add_theme_support( 'align-wide' );

@christophherr
Copy link
Member

@Tsquare17
Copy link
Member

Tsquare17 commented Dec 8, 2018

I've added
add_theme_support( 'align-wide' );
As well as
add_theme_support( 'wp-block-styles' );

@Tsquare17
Copy link
Member

I was trying to pull halfway left from a point that wasn't center screen due to the sidebar layout.

@Bowriverstudio
Copy link
Author

I've got it working, but only at the child theme level. Thank you Christophherr and Tsquare.

add_theme_support( 'align-wide' );
add_theme_support( 'wp-block-styles' );

And css


wp-block-image.alignfull  {
  margin-left: ~"calc(50% - 50vw)";
  margin-right: ~"calc(50% - 50vw)";
  width: 100vw;
  max-width: 100vw;
 }

.wp-block-image.alignwide {
  margin-left: -25px;
  margin-right: -25px;
  max-width: calc(100% + 50px);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants