Skip to content

Commit

Permalink
Add wp-image-[ID] class to img tag so WP adds srcset
Browse files Browse the repository at this point in the history
The AB Container block background image did not have a srcset.
Adding the class wp-image-[ID] to the img tag triggers WP
to add a srcset to the image. For more info see:
WordPress/gutenberg#8593
  • Loading branch information
tristanmason committed Sep 15, 2019
1 parent ca2e376 commit b58b416
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/blocks/block-container/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ registerBlockType( 'atomic-blocks/ab-container', {
<div className="ab-container-image-wrap">
<img
className={ classnames(
'ab-container-image',
'ab-container-image wp-image-' . containerImgID,
dimRatioToClass( containerDimRatio ),
{
'has-background-dim': 0 !== containerDimRatio
Expand Down

0 comments on commit b58b416

Please sign in to comment.