Open bobbingwide opened 3 years ago
These styles didn't appear to work with the Fizzie FSE theme.
With Genesis-a2z the styles are in the HTML as:
<link rel='stylesheet' id='oik_blocks-blocks-css-css' href='https://wp.a2z/wp-content/plugins/oik-blocks/blocks/build/css/blocks.style.css?ver=1611920674' type='text/css' media='all' />
and the HTML is
<div class="wp-block-oik-block-blockicon is-style-svg24"><span class="block-editor-block-icon"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true"><path d="M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"></path></svg></span></div>
With Fizzie it's the same thing - with a different URL
<link rel='stylesheet' id='oik_blocks-blocks-css-css' href='https://blocks.wp.a2z/wp-content/plugins/oik-blocks/blocks/build/css/blocks.style.css?ver=1611920674' type='text/css' media='all' />
and the HTML is
<div class="wp-block-oik-block-blockicon svg64 is-style-svg24"><span class="block-editor-block-icon"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true"><path d="M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"></path></svg></span></div>
The svg64
class was being added in the Additional CSS class(es) field.
Fix: Remove the extra svg64
class from the Additional CSS class(es) field for each block.
The solution works for icons which were svg files, but not for dashicons. Additional CSS is required.
Blocks for which the icons do not respond to different styles:
Having corrected blockicons I also needed to change blockinfo to support the additional CSS class svg64
.
When I first tried to add styles to the block icon block I managed to write some CSS to display the icon with 4 different sizes:
It worked if I used the additional CSS class above but not when the class name was prefixed with
is-style
. egis-style-svg64
.On reinvestigation - after finding out how to style paragraphs, list and groups into mutiple columns - I found some CSS that enables the
is-style-svg64
CSS to take effect in the editor. It overrides the WordPress core styling for the.block-editor-block-icon
class, setting the display toinline
( wasflex
).Requirement
oik-blocks/blockicon
blockSolution