Open bobbingwide opened 3 years ago
Discover what's needed to style icons that have the following attributes that need a little more care and attention: fill, fill-rule, cllp-rule etc
Adding the fill: currentColor;
property to the style.scss
files which are procesed into style-index.css
half fixed the problem.
eg This was the CSS for the block list block.
.wp-block-oik-block-blocklist svg {
width: 24px;
height: 24px;
fill: currentColor;
}
But...
It would appear that Gutenberg 11.9.0 now enqueues the CSS for each block, not the plugin as a whole.
The changes for this issue were committed in d69b5c9 and abfdcc3 oik-blocks v1.3.0 is being alpha tested on blocks.wp-a2z.org
Other people were having problems with a number of icons. See https://github.com/WordPress/gutenberg/pull/36564 It looks like I'll need to revisit these icons in https://github.com/bobbingwide/txt2md/issues/7 as well.
See also https://github.com/bobbingwide/oik-bob-bing-wide/issues/46#issuecomment-1063881371 where icons weren't visible.
For one icon, it was the fill-rule: evenOdd
property that prevented the icon from being visible on a white background.
Problems with Columns variations icons
In earlier versions of Gutenberg certain icons appear differently in the editor than in the front end. eg Columns variations. In the block editor the icons are not filled with black
Problem with Comment Author Name icon
With Gutenberg 11.9.0 the icon for the new Comment Author Name block is visible in the block icon block in the editor but not in other blocks nor on the front end.
The SVG for the Comment Author Name block is
Here we see the
fill='#FFFFFF'
attribute on the SVG tag. For the block info block the icon is invisible.Using the inspector and changing this value to
#CCCCCC
, for example, allows us to see the icon in the block editor. Alternatively we can set a background colour.This problem was originally mentioned in https://github.com/bobbingwide/oik-blocks/issues/50#issue-1055286475
Requirement
Proposed solution