-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Heading UI components should be provided both as a dropdown and buttons #2451
Comments
EDIT: I extracted this part to https://github.com/ckeditor/ckeditor5-ui/issues/322. This is a bit tricky. Introducing buttons and dropdown will bloat the code size. Exactly what we want to avoid. So, we need to be smart. I'd have two ideas:
toolbar: [
{
type: 'dropdown',
items: [ 'paragraph', 'heading1', 'heading2' ]
},
'bold',
'italic'
] or as separate buttons: toolbar: [
'paragraph',
'heading1',
'heading2',
'bold',
'italic'
] Or as a button group (a set of buttons adjacent to each other): toolbar: [
{
type: 'group',
items: [ 'paragraph', 'heading1', 'heading2' ]
},
'bold',
'italic'
] Would render the 3 buttons like the alignment options in MS Word: The second option is far more powerful, but requires more work too. Thanks to supporting for such configurations, the developer would be able to design his/her toolbar in a declarative way without creating a new editor plugin. However, there are some challenges. E.g. the dropdown needs some labels and the label may need to be contextual. Related ticket: ckeditor/ckeditor5-design#143 |
Yes, mix and match different buttons together will make our life easier, especially when we want to restrict some use cases. For example, I'd like to use few buttons(without a drop down menu) and output markdown format or simple html format without embed style tags, so that I can change the style easily later on. |
Related ticket: #455. |
Since there are 2 popular ways to have a heading feature: dropdown or separate buttons for separate heading level, I think that dropdown should provide UI components for both. Since this is not much code we could make it simpler and
Heading
plugin could add all component. Then, it's up to the editor's configuration which options developer want to have enabled:The text was updated successfully, but these errors were encountered: