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

Add scope to iframe 100% width css style #18050

Closed
barryceelen opened this issue Oct 21, 2019 · 5 comments
Closed

Add scope to iframe 100% width css style #18050

barryceelen opened this issue Oct 21, 2019 · 5 comments
Labels
Needs Design Feedback Needs general design feedback.

Comments

@barryceelen
Copy link
Contributor

Gutenberg global styles insist that an iframe should be 100% wide.

This overrides any iframe width or height attributes, I guess to be able to render videos and such responsively, but leads to trouble where the width and height attributes should not be overridden (in our case: ads).

Expected behavior
The width: 100% iframe style should be scoped to the block that needs it, in stead of being global.

@gziolo gziolo added the Needs Design Feedback Needs general design feedback. label Oct 23, 2019
@NicktheGeek
Copy link

Second to this. Currently the stylesheet is outputting even when gutenberg is disabled and it is breaking live sites that are on WP 5.3.

@NicktheGeek
Copy link

Follow up here as some folks may end up searching for a solution. In my case the styles shouldn't even be loaded because GB is not enabled on the sites this was breaking, so I just added wp_dequeue_style( 'wp-block-library' ); to the wp_enqueue_scripts hook. I'm hoping to make that a temp change as I'd like to see GB support on these sites eventually, but this CSS needs to change.

@federicojacobi
Copy link

This works really nicely:

add_action( 'enqueue_block_assets', function() {
	wp_dequeue_style( 'wp-block-library' );
	if ( current_theme_supports( 'wp-block-styles' ) ) {
		wp_dequeue_style( 'wp-block-library-theme' );
	}
} );

It is basically the reverse of https://github.com/WordPress/WordPress/blob/master/wp-includes/script-loader.php#L2831

@bengreeley
Copy link
Contributor

+1 Seeing this mess up ads that don't have explicit width/height attributes specified in the iFrame code. Disabling the Gutenberg plugin and relying on core functionality for now, but it would be great if this was fixed.

@bengreeley
Copy link
Contributor

Actually, looks like it may be fixed 🎉 #18287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

No branches or pull requests

5 participants