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

Override icon class names #448

Open
vanillajonathan opened this issue May 17, 2022 · 5 comments
Open

Override icon class names #448

vanillajonathan opened this issue May 17, 2022 · 5 comments

Comments

@vanillajonathan
Copy link
Contributor

vanillajonathan commented May 17, 2022

Is your feature request related to a problem? Please describe.
I already use a icon set, and don't want to also use Font Awesome.

Describe the solution you'd like
A iconClassNames option which provides a dictionary/map to define the icon class names.

Additional context
See Bootstrap Icons.

Would be:

iconClassNames: {
    toggleBold: 'bi bi-type-bold',
    toggleItalic: 'bi bi-type-italic',
    toggleStrikethrough: 'bi bi-type-strikethrough',
    toggleHeading1: 'bi bi-type-h1',
    toggleHeading2: 'bi bi-type-h2',
    toggleHeading3: 'bi bi-type-h3',
    toggleCodeBlock: 'bi bi-code',
    toggleBlockquote: 'bi bi-quote',
    toggleOrderedList: 'bi bi-list-ol',
    toggleUnorderedList: 'bi bi-list-ul',
    cleanBlock: 'bi bi-eraser',
    drawLink: 'bi bi-link',
    drawImage: 'bi bi-image',
    drawTable: 'bi bi-table',
    drawHorizontalRule: 'bi bi-hr',
    togglePreview: 'bi bi-eye',
    toggleSideBySide: 'bi bi-layout-split',
    toggleFullScreen: 'bi bi-fullscreen',
    guide: 'bi bi-question-circle',
    undo: 'bi bi-arrow-counterclockwise',
    redo: 'bi bi-arrow-clockwise'
}
@vanillajonathan
Copy link
Contributor Author

Starting out by refactoring into a map #454

@Ionaru
Copy link
Owner

Ionaru commented May 19, 2022

You can use autoDownloadFontAwesome: false and provide the toolbar configuration option with buttons that use other icons with the className attribute.

@vanillajonathan
Copy link
Contributor Author

Yes, but then integrator would have to manually recreate their own custom buttons for every button.

This commit separates concerns so it relies on a map which we can later override to make it easier for integrators to use their own icons.

@Ionaru
Copy link
Owner

Ionaru commented May 19, 2022

While I appreciate the work you're doing to make the editor as user-friendly as possible, I fear that all this work will go to waste when #447 happens, especially for extra configuration options to handle things that are already possible using other methods.

@vanillajonathan
Copy link
Contributor Author

Yeah, maybe, but then there is always the option for integrators to stay with the latest EasyMDE 2 version.

I would hope to see this merged.

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

No branches or pull requests

2 participants