-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor bw_dash and bw_github to use the shared library for class OIK_SVG_icons #46
Comments
There are now 620 or so icons. Manually checking the SVG definitions could take a long time. |
I've updated the Now I'm looking for an appropriate icon selection tool. I found this issue which is still open. It appears that Gutenberg core doesn't yet have an IconSelect component |
I also changed the code so that the blocks are rendered server side from the SVG rather than dashicons.css and font. In the editor the block only supports icons which are dashicons. Once done I should be able to extend the logic to support block icons. |
Getting this code to work took a lot of effort. The
I'd previously been trying to use.
|
I was helped by Glen Davies who showed some example code. His comment for the ... the old save method, even though it seems like it is not The key word being old. It seemed to work for some blocks but not for those with Additional CSS class(es) or other versions of the block that was created along the way which may have been created using flaky code that's since been updated. |
After much battling I have finally discovered how to use the CustomSelectControl to create a simple selection list for SVG icons.
The logic to set the text colour and size doesn't work on the server. This may need CSS styling and/or extra attribute handling.
|
Try replacing the Font size with a Size control for the SVG. But...
I managed to get the CSS to colour the SVG icons.
Now to apply the size logic to the server rendering. |
Delivered in oik-bob-bing-wide v2.2.1 |
In the list of SVG dash icons produced to display the bw_dash shortcode’s examples there are 3 icons which are not visible.
They're styled correctly when displayed by the Dashicon block.
Add this as inline CSS when inside the |
The
but it is visible in the CustomSelectControl.
ExplanationThis is due to the https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule |
For improved front end performance of the
[bw_follow_me]
shortcode I changed the logic to support SVG icons rather thandashicons or genericons. Use
theme=svg
to choose this.I implemented a shared library class OIK_SVG_icons for the purpose.
Requirements
[bw_dash]
shortcode.[bw_github]
shortcode.Proposed solution
See also bobbingwide/oik#187 for notes about the [github] shortcode
The text was updated successfully, but these errors were encountered: