$definition->addAttribute('img', 'data-attachment-id', 'Number');
$definition->addAttribute('img', 'srcset', 'Text');
+ // <figure> element for images
+ $definition->addElement('figure', 'Block', 'Flow', '', [
+ 'class' => 'Text',
+ ]);
+
$parameters = [
'config' => $config,
'definition' => $definition,
* @var array<array>
*/
public static $allowedClassNames = [
+ 'figure' => ['image', 'image-style-side'],
'h2' => ['text-center', 'text-justify', 'text-right'],
'h3' => ['text-center', 'text-justify', 'text-right'],
'h4' => ['text-center', 'text-justify', 'text-right'],
margin-bottom: 0 !important;
}
}
+
+ figure.image {
+ clear: both;
+ display: table;
+ margin: 1em auto;
+ min-width: 50px;
+ text-align: center;
+
+ &.image-style-side {
+ float: right;
+ margin: 0 0 20px 20px;
+ }
+ }
}
.containerContent,