vigetlabs / wordpress-site-starter

2 stars 0 forks source link

[#26] Button Icons #31

Closed bd-viget closed 2 months ago

bd-viget commented 2 months ago

Summary

This PR adds a custom Icon Panel to the Core Button block, with a set of built-in icons. There is a filter to customize the icons: acfbt_button_icons.

We could consider adding a built-in utility in the wp-starter theme that filters the icons based on SVGs in a directory within the theme, or maybe also query SVGs uploaded to the Media Library. Open to suggestions.

[EDIT] Another note: We'll need to probably add this to our deploy script and update the .gitignore, and the icons.json file is stored in the plugin directory, so it might be better to move that to the wp-content/uploads folder.

Issues

Testing Instructions

  1. Create a button
  2. Select an Icon

Screenshots

Icon Selection

Screenshot 2024-04-24 at 8 10 18 PM

Example Button

Screenshot 2024-04-24 at 8 10 34 PM
bd-viget commented 2 months ago

@nathan-schmidt-viget

I think the JS CSS just needs to be run through prettier. Let me know if you want me to do that for you.

Do you mind adding whatever is needed for prettier in the acf-blocks-toolkit plugin folder and package.json? That'd be awesome! If not, I can give it a shot, just never set it up before.

nathan-schmidt-viget commented 2 months ago

@bd-viget I have fixed the formatting. I think some of the indentation just looks weird on Git because it is tab, but in VS code it looks good. I did not add prettier to the plugin, will open a new PR for that as well as bumping up to node 20