Skip to content
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

Add support for custom icons #34

Open
cannikin opened this issue Feb 17, 2025 · 2 comments · May be fixed by #39
Open

Add support for custom icons #34

cannikin opened this issue Feb 17, 2025 · 2 comments · May be fixed by #39

Comments

@cannikin
Copy link

cannikin commented Feb 17, 2025

Loving this gem!

I wish I could pull the icons in the toolbar from my own iconset so they match the rest of my site's look and feel. I tried overriding Marksmith::Helper#marksmith_toolbar_button but it looks like the one in the engine is used before any helper defined in the Rails app.

I'm not sure how to go about this in an elegant way...maybe a config hash that takes the name of the function (bold, italic) and maps it to a proc, which you can define to pull an image or an SVG or anything else? Now sure how well this plays with the asset pipeline...maybe it could be configured to use a named Rails helper first, if defined, and if not fallback to the existing image_tag and included SVG icons?

I did discover that if I copy views/marksmith/shared/_editor.html.erb to my own codebase then I can change anything I want, including the icons! However, this makes it much more difficult to stay in sync with updates from the main gem. ☹️

@adrianthedev
Copy link
Contributor

I see what you mean @cannikin
Would extracting that particular area with the icons to a separate partial that you could override make it easier?

I'm not sure if we want to introduce a configuration value and separate DSL just for that at this moment in time.

@adrianthedev adrianthedev linked a pull request Feb 22, 2025 that will close this issue
@adrianthedev
Copy link
Contributor

@cannikin Can you please give #39 a shot?
I may have went overboard with everything, and a refactor with all those arguments is warranted.
But I'd like to get your feedback on it first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants