-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Custom button, or override the svg icons on toolbar #1099
Comments
You can import ui/icons and override icons: var icons = Quill.import('ui/icons');
icons['bold'] = '<i class="fa fa-bold" aria-hidden="true"></i>'; |
That's great, thanks. |
@benbro In case that we want to add custom button to toolbar (e.g. fullscreen btn), following warning occured: |
@skmohammadi you probably need to register your custom format as well. |
@benbro the mentioned links have not helped me. How can define new format? |
@skmohammadi please search stackoverflow for similar questions: |
@benbro Thanks 👍 |
@benbro's solution work for me. var icons = Quill.import('ui/icons');
icons['header']['2'] = '<img src="/static/editor-icon/editor-new/H.png" class="fm_editor_icon">';
icons['bold'] = '<img src="/static/editor-icon/editor-new/bold-black.png" class="fm_editor_icon">';
icons['italic'] = '<img src="/static/editor-icon/editor-new/italic.png" class="fm_editor_icon" id="fm_icon_italic">';
icons['underline'] = '<img src="/static/editor-icon/editor-new/line.png" class="fm_editor_icon">';
icons['strike'] = '<img src="/static/editor-icon/editor-new/delete.png" class="fm_editor_icon">';
icons['blockquote'] = '<img src="/static/editor-icon/editor-new/quote.png" class="fm_editor_icon">';
icons['list'] = '<img src="/static/editor-icon/editor-new/list.png" class="fm_editor_icon">'; |
So, to be clear, is there no way to have quill just use the buttons and NOT modify them? I have a fully styled toolbar that is extremely custom, and having to override quill against our current system is both inconvenient as well as introduces complexity against future changes for our icon button system. This will introduce bugs for us down the road. |
@dudewad you can just add event listeners to your extremely custom buttons and invoke appropriate formats manually |
Color and background custom font ICONS are selected without updating the icon style. Is there any way to do this |
@dudewad Did you find a way to call an existing handler? I want to be able to programmatically call a handler. For example, let's say I have my own function that should work exactly like "Bold" button in the toolbar. I don't have my own "bold" UI element, I just want to invoke the bold handler on the currently selected text. Is that possible? |
If anyone is looking to use Antd icons or any icons with JSX syntax for that matter, convert the JSX syntax to html first i.e.
|
can i replace dropdown.svg somehow? |
Overwriting variables in other js modules is not really a clean solution. I found a simple solution: use the default theme instead of the snow theme. |
What about color or background color coz they use select tag instead of button |
This works but it's throwing a |
This works, but i have the issue with list option. I have ordered list and bullet option. but it's not working properly for both. i want to give different icons to them. how can i do it if anyone have the idea ??? |
I want to integrate Quill with an app that has existing toolbars with buttons styled with fontawsome font icons. If I use the snow theme with a custom tool bar (setting a button with a font icon with the e.g. ql-bold class), the contents are overridden with the svg icon.
Whats the best (probably easiest) approach to use buttons with my own content? I could use my own buttons with javascript handlers that, e.g. apply bold to the selected text, but then how do I detect when the cursor is in a bold section of text so that I can set an appropriate active class on my button?
Alternatively, is there a way to prevent the snow theme replacing the button content with the svg (but otherwise act as per the standard snow toolbar)?
Sorry if this is something simple, I couldn't find anything that covered this in the docs or existing issues, and I'm new to quill.
The text was updated successfully, but these errors were encountered: