Skip to content

Commit

Permalink
Sort strikethrough after link (#8755)
Browse files Browse the repository at this point in the history
This is a tiny PR to sort the "Strikethrough" button after the link.

One of the... perhaps this is unwritten and should be written down somewhere... one of the design principles of the block toolbar is that it starts with block related commands (like switcher), then _block level_ (i.e. actions that apply to the whole block, like textalign applies for the whole paragraph), and finally _inline level actions_ last. In the latter, it is sorted by presumed order of importance, and in this case, I would like to argue that Link is more important than Strikethrough.

One side effect of this is that one day when we can make the toolbar better handle nested contexts or small screens, we can "pop off" buttons into an overflow menu as the toolbar has to scale. If/when that happens, it's important that buttons are also sorted in order of importance.
  • Loading branch information
jasmussen authored Aug 9, 2018
1 parent a0d9405 commit 0298cff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/editor/src/components/rich-text/format-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ const FORMATTING_CONTROLS = [
shortcut: displayShortcut.primary( 'i' ),
format: 'italic',
},
{
icon: 'editor-strikethrough',
title: __( 'Strikethrough' ),
shortcut: displayShortcut.access( 'd' ),
format: 'strikethrough',
},
{
icon: 'admin-links',
title: __( 'Link' ),
shortcut: displayShortcut.primary( 'k' ),
format: 'link',
},
{
icon: 'editor-strikethrough',
title: __( 'Strikethrough' ),
shortcut: displayShortcut.access( 'd' ),
format: 'strikethrough',
},
];

// Default controls shown if no `enabledControls` prop provided
Expand Down

0 comments on commit 0298cff

Please sign in to comment.